Retrieve OAuth2 provider tokens from callback
Changed onAfter successful OAuth2 authentication, retrieve the provider session containing access token, refresh token, and expiration information for the specified provider. To ensure the data isn't stale this endpoint must be called immediately after the OAuth callback to obtain the tokens. The session is cleared from the database during this call, so subsequent calls will fail without going through the sign-in flow again. It is the user's responsibility to store the session safely (e.g., in browser local storage).
Request
- Base URLhttps://{subdomain}.auth.{region}.nhost.run/v1
- URLhttps://{subdomain}.auth.{region}.nhost.run/v1/signin/provider/{provider}/callback/tokens
- AuthHTTP bearer
Path parameters
The name of the social provider
Response
Successfully retrieved provider session
Example response
{
"accessToken": "ya29.a0AfH6SMBx...",
"expiresIn": 3599,
"expiresAt": "2024-12-31T23:59:59Z",
"refreshToken": "1//0gK8..."
}Changes
- warning
added the new
otp-too-many-attemptsenum value to theresponse property for the response status
- warning
- warning
added the new
user-already-existsenum value to theresponse property for the response status - info
removed the
email-already-in-useenum value from theresponse property for the response status
- warning