http.oidc.exchange

http.oidc

exchange(self, code, verifier) -> tokens, err

Exchange an authorization code for the tokens

POST at the token endpoint with grant_type=authorization_code, the code, the redirect URI and the verifier, under client_secret_basic (RFC 6749 §2.3.1): the id and the secret form-escaped, joined by a colon and base64-encoded. The response must be a JSON object with string access_token and id_token and a token_type of Bearer in any case; it comes back whole, expires_in and scope included. An OAuth error reads token: <error>: <error_description>. The ID token is not verified here: verify_id_token takes it with the nonce.