public function createAccessToken(HTTP_OAuth2_ResponseType_AccessTokenInterface $accessToken, $client_id, $user_id, $scope) { /** * Client Credentials Grant does NOT include a refresh token * * @see http://tools.ietf.org/html/rfc6749#section-4.4.3 */ $includeRefreshToken = false; return $accessToken->createAccessToken($client_id, $user_id, $scope, $includeRefreshToken); }
public function createAccessToken(HTTP_OAuth2_ResponseType_AccessTokenInterface $accessToken, $client_id, $user_id, $scope) { /* * It is optional to force a new refresh token when a refresh token is used. * However, if a new refresh token is issued, the old one MUST be expired * @see http://tools.ietf.org/html/rfc6749#section-6 */ $issueNewRefreshToken = $this->config['always_issue_new_refresh_token']; $token = $accessToken->createAccessToken($client_id, $user_id, $scope, $issueNewRefreshToken); if ($issueNewRefreshToken) { $this->storage->unsetRefreshToken($this->refreshToken['refresh_token']); } return $token; }
public function createAccessToken(HTTP_OAuth2_ResponseType_AccessTokenInterface $accessToken, $client_id, $user_id, $scope) { $includeRefreshToken = true; if (isset($this->authCode['id_token'])) { // OpenID Connect requests include the refresh token only if the // offline_access scope has been requested and granted. $scopes = explode(' ', trim($scope)); $includeRefreshToken = in_array('offline_access', $scopes); } $token = $accessToken->createAccessToken($client_id, $user_id, $scope, $includeRefreshToken); if (isset($this->authCode['id_token'])) { $token['id_token'] = $this->authCode['id_token']; } $this->storage->expireAuthorizationCode($this->authCode['code']); return $token; }
/** * Creates an access token that is NOT associated with a refresh token. * If a subject (sub) the name of the user/account we are accessing data on behalf of. * * @see OAuth2\GrantType\GrantTypeInterface::createAccessToken() */ public function createAccessToken(HTTP_OAuth2_ResponseType_AccessTokenInterface $accessToken, $client_id, $user_id, $scope) { $includeRefreshToken = false; return $accessToken->createAccessToken($client_id, $user_id, $scope, $includeRefreshToken); }
public function createAccessToken(HTTP_OAuth2_ResponseType_AccessTokenInterface $accessToken, $client_id, $user_id, $scope) { $token = $accessToken->createAccessToken($client_id, $user_id, $scope); $this->storage->expireAuthorizationCode($this->authCode['code']); return $token; }
public function createAccessToken(HTTP_OAuth2_ResponseType_AccessTokenInterface $accessToken, $client_id, $user_id, $scope) { return $accessToken->createAccessToken($client_id, $user_id, $scope); }