- POST /token#
This is the token endpoint of the OAuth 2.0 specification. This endpoint is used by the client to provide its authorization code, demonstrating that it has the right to learn a particular user’s validated address. In return, the challenger service returns the access token. Renewal is not supported.
Request:
The request must include an
application/www-form-urlencodedbody specifying theclient_id,redirect_uri,client_secret,codeandgrant_type. Thegrant_typemust be set toauthorization_code. Theredirect_urimust match the URI from/authorize. Thecodemust be the authorization code that/solvereturned to the user. Theclient_idandclient_secretmust match the usual client credentials. Since protocol v3,code_verifiercan also be included.Response:
Error responses follow RFC 6749, section 5.2 with an “error” field in JSON, as well as also returning GNU Taler style error messages.
- 200 OK:
The body will be a ChallengerAuthResponse.
- 400 Bad Request:
A required POST field (
grant_type,client_id,client_secret,codeorredirect_uri) is missing or malformed, orgrant_typeis notauthorization_code. Usually returned withTALER_EC_GENERIC_PARAMETER_MISSINGorTALER_EC_GENERIC_PARAMETER_MALFORMED.- 401 Unauthorized:
Authentication of the client failed. Returned (per RFC 6749, section 5.2) when the client credentials are invalid, when the supplied
codeis malformed or does not match the validation, when theredirect_uridoes not match the one registered with the client, or when thecode_verifierdoes not match the savedcode_challenge. Returned withTALER_EC_CHALLENGER_GENERIC_CLIENT_FORBIDDEN_BAD_REDIRECT_URI,TALER_EC_CHALLENGER_CLIENT_FORBIDDEN_BAD_CODE,TALER_EC_CHALLENGER_GENERIC_VALIDATION_UNKNOWNorTALER_EC_CHALLENGER_GRANT_UNKNOWN. PKCE-related rejections are since protocol v3.- 404 Not found:
The service is unaware of a matching login process or client. Returned with error codes of
TALER_EC_CHALLENGER_GENERIC_CLIENT_UNKNOWN- 409 Conflict:
A
codewas presented for a validation process for which the user has not (yet) submitted any address, so the token cannot be issued. Returned withTALER_EC_CHALLENGER_MISSING_ADDRESS.- 500 Internal Server Error:
The challenger service encountered an internal error, for example a database failure or a failure of the SHA-256 or Base64 helpers used for PKCE verification. Error codes used are: *
TALER_EC_CHALLENGER_GENERIC_DB_FETCH_FAILED*TALER_EC_CHALLENGER_GENERIC_DB_STORE_FAILED
Details::
interface ChallengerAuthResponse { // Token used to authenticate access in /info. access_token: string; // Type of the access token. token_type: "Bearer"; // Amount of time that an access token is valid (in seconds). expires_in: Integer; }