| Line | Code |
| 1 | <?php
|
| 2 |
|
| 3 | /**
|
| 4 | The implicit grant is a simplified authorization code flow optimized
|
| 5 | for clients implemented in a browser using a scripting language such
|
| 6 | as JavaScript. In the implicit flow, instead of issuing the client
|
| 7 | an authorization code, the client is issued an access token directly
|
| 8 |
|
| 9 | (as the result of the resource owner authorization). The grant type
|
| 10 | is implicit, as no intermediate credentials (such as an authorization
|
| 11 | code) are issued (and later used to obtain an access token).
|
| 12 |
|
| 13 | When issuing an access token during the implicit grant flow, the
|
| 14 | authorization server does not authenticate the client. In some
|
| 15 | cases, the client identity can be verified via the redirection URI
|
| 16 | used to deliver the access token to the client. The access token may
|
| 17 | be exposed to the resource owner or other applications with access to
|
| 18 | the resource owner's user-agent.
|
| 19 |
|
| 20 | Implicit grants improve the responsiveness and efficiency of some
|
| 21 | clients (such as a client implemented as an in-browser application),
|
| 22 | since it reduces the number of round trips required to obtain an
|
| 23 | access token. However, this convenience should be weighed against
|
| 24 | the security implications of using implicit grants, such as those
|
| 25 | described in Sections 10.3 and 10.16, especially when the
|
| 26 | authorization code grant type is available.
|
| 27 | */
|
| 28 |
|
| 29 | namespace AuthStack\OAuth2\Model\Protocol\Grant;
|
| 30 |
|
| 31 | use AuthStack\OAuth2\Model\Protocol\Request\Implicit\GrantRequest;
|
| 32 | use AuthStack\OAuth2\Model\Protocol\Response\Implicit\GrantResponse;
|
| 33 |
|
| 34 | class Implicit implements GrantInterface
|
| 35 | {
|
| 36 | public function grantRequest(): GrantRequest
|
| 37 | {
|
| 38 | return new GrantRequest();
|
| 39 | }
|
| 40 |
|
| 41 | public function grantResponse(): GrantResponse
|
| 42 | {
|
| 43 | return new GrantResponse();
|
| 44 | }
|
| 45 | } |