Retrieves details about a pending OAuth authorization request so you can render a consent screen. The authorizationId is provided as a query parameter on the redirect URL that starts the flow.
OAuthAuthorizationResponse. Handle both variants: OAuthAuthorizationDetailsResponse carries the requesting client and requested scope for the consent screen, while OAuthAuthorizationRedirectResponse is returned when the user has already granted consent and only carries a redirectUrl to forward to.The unique identifier of the pending authorization request.
final authorizationId =
Uri.parse(currentUrl).queryParameters['authorization_id']!;
final response =
await supabase.auth.oauth.getAuthorizationDetails(authorizationId);
switch (response) {
case OAuthAuthorizationRedirectResponse(:final redirectUrl):
// The user already consented; forward them without a consent screen.
break;
case OAuthAuthorizationDetailsResponse(:final client, :final scope):
// Render a consent screen for `client` requesting `scope`.
break;
}