How to use the AuthorizationCode
MingyueMa opened this issue · 2 comments
Hi
When someone use the third party login to my system without password,like Authorization code , how should I create access_token ? In the configuration file , I did like this
'modules' => [ 'oauth2' => [ 'class' => 'filsh\yii2\oauth2server\Module', 'tokenParamName' => 'accessToken', 'tokenAccessLifetime' => 3600 * 24 * 7, 'refreshTokenLifetime' => 3600 * 24 * 30, 'storageMap' => [ 'user_credentials' => 'common\models\WtkUser', ], 'grantTypes' => [ 'authorization_code' => [ 'class' => 'OAuth2\GrantType\AuthorizationCode' ], 'refresh_token' => [ 'class' => 'OAuth2\GrantType\RefreshToken', 'always_issue_new_refresh_token' => true ] ] ], ],
the model 'WtkUser' was defined in 'common\models\WtkUser.php' , this class implements \OAuth2\Storage\AuthorizationCodeInterface , there are three function should be implemented , but I don't know how to do it ? Anyone can help me?
Thanks again!
oh,i havent user the AuthorizationCode, i cann
t understand what you wrote
真的不是很懂哦