Difference between revisions of "CMU OAUTH PHP CLASS"
From CMU ITSC Network
| Line 117: | Line 117: | ||
=== getAccessToken === | === getAccessToken === | ||
| + | Get user's authorized access token. | ||
| + | {| class="wikitable" | ||
| + | |+ style="text-align:left;"|Description | ||
| + | |- | ||
| + | |object getAccessToken($code) | ||
| + | |} | ||
| + | |||
| + | {| class="wikitable" | ||
| + | |+ style="text-align:left;"|Parameters | ||
| + | |- | ||
| + | |name || description | ||
| + | |- | ||
| + | |code | ||
| + | |code that parse by CMU Oauth to redirect URI. | ||
| + | |} | ||
| + | |||
| + | {| class="wikitable" | ||
| + | |+ style="text-align:left;"| Return Values | ||
| + | |- | ||
| + | | object | ||
| + | |- | ||
| + | |<pre>{ | ||
| + | "access_token": "66822448858031556636", | ||
| + | "expires_in": 3600, | ||
| + | "refresh_token": "23178027621214615262" | ||
| + | }</pre> | ||
| + | |} | ||
| + | |||
=== getUserInfo === | === getUserInfo === | ||
== Examples == | == Examples == | ||
Revision as of 11:29, 24 September 2017
Method
Constructor
Set Client ID, Client Secret, Redirect URI
| __construct([string $appId, string $clientSecret, string $redirectURI]) |
| name | description |
| appId | cmu oauth Client ID |
| clientSecret | cmu oauth Client Secret |
| redirectURI | cmu oauth Redirect URI |
| no return value |
setAppId
set Client ID
| setAppId(string $appid) |
| name | description |
| appid | cmu oauth Client ID |
| no return value |
setAppSecret
Set Client Secret
| setAppSecret(string $appSecret) |
| name | description |
| appSecret | cmu oauth Client Secret |
| no return value |
setCallbackUri
Set Redirect URI
| setCallbackUri(string $uri) |
| name | description |
| uri | Application Callback / Redirect URI |
| no return value |
initOauth
Initial redirect to CMU Oauth for authorization.
| initOauth() |
| no parameter |
| no return value |
getAccessToken
Get user's authorized access token.
| object getAccessToken($code) |
| name | description |
| code | code that parse by CMU Oauth to redirect URI. |
| object |
{
"access_token": "66822448858031556636",
"expires_in": 3600,
"refresh_token": "23178027621214615262"
}
|