Attempt to exchange authorization code for bearer token.
Takes the authorization code returned by the OpenID Provider via the authorization URL, and makes a
request to the Token Endpoint, to obtain the access token, refresh token, etc.
Param: code
authorization code as returned by OP during authorization
Param: storedAuthorizationParams
stored params from start of oidc login flow
Returns
valid bearer token response
Throws
An Error with message set to an entry in OidcError,
when the request fails, or the returned token response is invalid.
Attempt to exchange authorization code for bearer token.
Takes the authorization code returned by the OpenID Provider via the authorization URL, and makes a request to the Token Endpoint, to obtain the access token, refresh token, etc.
Param: code
authorization code as returned by OP during authorization
Param: storedAuthorizationParams
stored params from start of oidc login flow
Returns
valid bearer token response
Throws
An
Error
withmessage
set to an entry in OidcError, when the request fails, or the returned token response is invalid.