Jump to content

sso question


chubaka

Recommended Posts

Hello.

 

Regarding https://docs.whmcs.com/WHMCS_Single_Sign-On_Developer_Guide

1. The application requests an access token by sending its credentials to the OAuth Token API Endpoint

 

$post_data = Array(
'code' => $code,
'client_id' => $client_id,
'client_secret' => $client_secret,
'redirect_uri' => $redirect_uri,
'grant_type' => 'authorization_code',
//'grant_type' => 'single_sign_on',
);

$curl = curl_init($whmcs_token_url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
$result = json_decode(curl_exec($curl));
curl_close($curl);

var_dump($result); die();

 

Where to get $code?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated