OAuthClient
class OAuthClient
Class OAuthClient
Constants
AUTHORIZATION_URI |
|
TOKEN_URI |
|
REVOKE_URI |
|
PERSISTENT_DATA_STATE_KEY |
|
Methods
__construct(YfyHttpClient $httpClient, PersistentDataHandler $persistentDataHandler = null, RandomStringGenerator $randomStringGenerator = null)
OAuthClient constructor.
mixed
refreshToken(string $refreshToken)
刷新token
mixed
getTokenByPasswordFlow(string $username, string $password)
通过密码模式获取token
revokeToken($token)
取消一个token的授权(对应的refresh token也会失效)
string
getAuthorizationUrl(string|null $state = null)
获取授权url
mixed
finishAuthorizationCodeFlow(string|null $code = null, string|null $state = null)
结束授权码流程
Details
at line 54
__construct(YfyHttpClient $httpClient, PersistentDataHandler $persistentDataHandler = null, RandomStringGenerator $randomStringGenerator = null)
OAuthClient constructor.
at line 68
protected YfyRawResponse
execute(YfyRequest $yfyRequest)
执行所有授权请求, 并且进行错误处理
at line 117
mixed
refreshToken(string $refreshToken)
刷新token
at line 157
mixed
getTokenByPasswordFlow(string $username, string $password)
通过密码模式获取token
at line 176
revokeToken($token)
取消一个token的授权(对应的refresh token也会失效)
at line 192
string
getAuthorizationUrl(string|null $state = null)
获取授权url
at line 219
mixed
finishAuthorizationCodeFlow(string|null $code = null, string|null $state = null)
结束授权码流程