login method
Implementation
Future<String> login(dynamic args) async {
final client = await createAuth0Client(
clientId: args['clientId'],
domain: args['domain'],
useRefreshTokens: true,
cacheLocation: "localstorage");
final isAuthenticated = await client.isAuthenticated();
if (!isAuthenticated) {
await client.loginWithPopup(
scope: args['scope'], audience: args['audience']);
}
final token = await client.getTokenSilently(
detailedResponse: true, audience: args['audience']);
Map<String, dynamic> tokenMap = {
'accessToken': token.accessToken,
'idToken': token.idToken,
'expiresIn': token.expiresIn
};
return jsonEncode(tokenMap);
}