- POST /setup/$CLIENT_ID#
This endpoint is used by the client to authorize the execution of an address validation on its behalf. An
Authorizationheader (for now always using aBearertoken) should be included to provide the client’s credentials to authorize access to the challenger service. This token must match theclient_secretfrom the registration of the client with the challenger service (which will also be used in the later/tokenrequest).Request:
The
Authorizationheader is mandatory and must be of the formBearer secret-token:$CLIENT_SECRET: the value is expected to carry the RFC 8959secret-token:prefix, and the prefix is part of the secret as stored bychallenger-admin. TheBearerscheme token is matched case-insensitively.The body can be an address in JSON encoding to pre-initialize the address to be used by challenger for this process. If the body is absent, the user will have to enter the full address details. The specific address format depends on the address type. However, ChallengeSetupRequest defines the shared
read_onlybit that has a special meaning independent of the address type: it informs Challenger that the address should not be editable.The body is optional: a request with no body at all, or with a body of length zero, is accepted and leaves the address unset. If a body is present it must be a JSON object; any other JSON value is rejected.
Passing an address in the
/setupbody is supported @since protocol v4.Response:
- 200 OK:
Response is a ChallengeSetupResponse.
- 400 Bad request:
The request is malformed. Error codes used are:
TALER_EC_GENERIC_PARAMETER_MALFORMED— the$CLIENT_IDin the URL is not a number (detailis"client_id"), the body is valid JSON but not an object (detailis"address"), orread_onlyis present in the body but is not a boolean (detailis"read_only").TALER_EC_GENERIC_JSON_INVALID— the body is not well-formed JSON.
- 403 Forbidden:
The client did not present usable credentials. Since protocol v8; previously reported as
400. In both casesdetailis"Authorization". Error codes used are:TALER_EC_GENERIC_PARAMETER_MISSING— there is noAuthorizationheader at all.TALER_EC_GENERIC_PARAMETER_MALFORMED— the header is present but does not use theBearerscheme, or its value lacks the RFC 8959secret-token:prefix.
- 404 Not found:
The challenger service is unaware of a matching client, or the credentials of the client are invalid. These two cases are deliberately not distinguished. Always returned with
TALER_EC_CHALLENGER_GENERIC_CLIENT_UNKNOWN.- 405 Method Not Allowed:
The request used a method other than
POSTorOPTIONS. Returned by the request router with anAllowheader and an empty body; in particular there is no Taler error code.- 500 Internal server error:
The challenger service encountered an internal error. Error codes used are:
TALER_EC_GENERIC_DB_STORE_FAILED— the database transaction that authenticates the client and inserts the validation failed, either hard or by exhausting the retries for serialization failures (detailis"do_insert_validation").TALER_EC_GENERIC_PARSER_OUT_OF_MEMORY— the service ran out of memory while buffering the request body.
Details::
interface ChallengeSetupRequest { // If true, the given address should not be edited. // Defaults to 'false' if not specified. read_only?: boolean; // Optional, additional fields to pre-populate // the address to be validated. // The fields depend on the challenger type. [x: string]: any; }
interface ChallengeSetupResponse { // Nonce to use when constructing /authorize endpoint. nonce: string; // Time when this validation process expires. After this time it can // no longer be authorized or exchanged for a token. // Available since protocol v9. expires: Timestamp; }