AuthorizationCodeGrantType
Kind: global class
new AuthorizationCodeGrantType(options)
| Param |
|---|
| options |
authorizationCodeGrantType.handle(request, client)
Handle authorization code grant.
Kind: instance method of AuthorizationCodeGrantType
See: https://tools.ietf.org/html/rfc6749#section-4.1.3
| Param | Type |
|---|---|
| request | Request |
| client | ClientData |
authorizationCodeGrantType.getAuthorizationCode(request, client) ⇒ Promise.<{user}>
Get the authorization code.
Kind: instance method of AuthorizationCodeGrantType
| Param | Type |
|---|---|
| request | Request |
| client | ClientData |
authorizationCodeGrantType.validateRedirectUri(request, code)
Validate the redirect URI.
"The authorization server MUST ensure that the redirect_uri parameter is present if the redirect_uri parameter was included in the initial authorization request as described in Section 4.1.1, and if included ensure that their values are identical."
Kind: instance method of AuthorizationCodeGrantType
See: https://tools.ietf.org/html/rfc6749#section-4.1.3
| Param | Type |
|---|---|
| request | Request |
| code | AuthorizationCodeData |
authorizationCodeGrantType.revokeAuthorizationCode(code)
Revoke the authorization code.
"The authorization code MUST expire shortly after it is issued to mitigate the risk of leaks. [...] If an authorization code is used more than once, the authorization server MUST deny the request."
Kind: instance method of AuthorizationCodeGrantType
See: https://tools.ietf.org/html/rfc6749#section-4.1.2
| Param | Type |
|---|---|
| code | AuthorizationCodeData |
authorizationCodeGrantType.saveToken(user, client, authorizationCode, requestedScope)
Save token.
Kind: instance method of AuthorizationCodeGrantType
| Param | Type |
|---|---|
| user | object |
| client | ClientData |
| authorizationCode | string |
| requestedScope | string |