$BD_OAUTH2_ENDPOINTS
$BD_OAUTH2_ENDPOINTS
Endpoints for Baidu OAuth2.0.
Client for Baidu OAuth2.0 service.
__construct(string $clientId = '', string $clientSecret = '') : mixed
Constructor
string | $clientId | Client_id of the baidu thirdparty app or access_key of the developer. |
string | $clientSecret | Client_secret of the baidu thirdparty app or secret_key of the developer. |
getAuthorizeUrl(string $responseType = 'code', string $scope = '', string $state = '', string $display = 'popup') : string
Get baidu oauth2's authorization granting url.
string | $responseType | Response type, 'code' or 'token' |
string | $scope | blank space separated list of requested extended perms |
string | $state | state parameter |
string | $display | Authorization page style, 'page', 'popup', 'touch' or 'mobile' |
Page url for authorization granting
getAccessTokenByDeveloperCredentials(string $accessKey, string $secretKey) : array|false
Get access token info by developer credentials
string | $accessKey | Access key you got from baidu cloud platform |
string | $secretKey | Secret key you got from baidu cloud platform |
Returns access token info if success, or false if failed
getAccessTokenByRefreshToken(string $refreshToken, string $scope = '') : array|false
Refresh access token by refresh token.
string | $refreshToken | The refresh token |
string | $scope | Extend permissions delimited by blank space |
returns access token info if success, or false if failed.
makeAccessTokenRequest(array $params) : mixed
Make an oauth access token request
The parameters:
array | $params | oauth request parameters |
returns access token info if success, or false if failed