A cloud-based identity and access management service for securing user authentication and resource access
@emmanuel hdz
To extract the token issued to a Flutter app, you try using the flutter_appauth package. This package provides a set of Flutter widgets and functions that make it easy to implement the OAuth 2.0 and OpenID Connect protocols in your app.
import 'package:flutter_appauth/flutter_appauth.dart';
final FlutterAppAuth appAuth = FlutterAppAuth();
final AuthorizationTokenResponse result =
await appAuth.authorizeAndExchangeCode(
AuthorizationTokenRequest(
'<client_id>',
'<redirect_uri>',
issuer: '<authority>',
scopes: ['openid', 'profile', 'email'],
),
);
final String accessToken = result.accessToken;
The authorizeAndExchangeCode() method is used to obtain an access token from Azure AD B2C. The method takes an AuthorizationTokenRequest object that specifies the client ID, redirect URI, authority, and scopes for the request. The method returns an AuthorizationTokenResponse object that contains the access token. You can extract the access token from the AuthorizationTokenResponse object by accessing the accessToken property. Another conceptual workaround could be referred here.
---Please "Accept the answer (Yes)" and "share your feedback ". This will help us and others in the community as well. Thanks, Akshay Kaushik
