-
Notifications
You must be signed in to change notification settings - Fork 949
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds code id_token grant type to openid connect
- Loading branch information
Showing
6 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace OAuth2\OpenID\ResponseType; | ||
|
||
class CodeIdToken implements CodeIdTokenInterface | ||
{ | ||
protected $authCode; | ||
protected $idToken; | ||
|
||
public function __construct(AuthorizationCodeInterface $authCode, IdTokenInterface $idToken) | ||
{ | ||
$this->authCode = $authCode; | ||
$this->idToken = $idToken; | ||
} | ||
|
||
public function getAuthorizeResponse($params, $user_id = null) | ||
{ | ||
$result = $this->authCode->getAuthorizeResponse($params, $user_id); | ||
$id_token = $this->idToken->createIdToken($params['client_id'], $user_id, $params['nonce']); | ||
$result[1]['query']['id_token'] = $id_token; | ||
|
||
return $result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace OAuth2\OpenID\ResponseType; | ||
|
||
use OAuth2\ResponseType\ResponseTypeInterface; | ||
|
||
interface CodeIdTokenInterface extends ResponseTypeInterface | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters