Closed veronicavg closed 7 years ago
I find this
public function createAccessToken($clientId, $userId, $scope = null, $includeRefreshToken = true)
{
$accessToken = $this->getAccessTokenResponseType();
return $accessToken->createAccessToken($clientId, $userId, $scope, $includeRefreshToken);
}
in Server.php. But how to use it?
have you read instructions in readme? If yes what's your problem?
Read and read again. I solved my problem in that way:
$module = Yii::$app->getModule('oauth2');
$token = $module->getServer()->createAccessToken("testclient", $id_utente, 'default', true);
Not so easy to understand. Maybe need a method in User models like "getAccessToken()"
When I perform the social login from my app, in the rest controller I create the user instance (if not exist), then i have to return the access token. In this case i don't have the password, i must create the token from the user object. How can i do that?