Line data Source code
1 : import 'package:openid_client/openid_client_io.dart' as openid; 2 : 3 : /// IO Implementation of Authenticator 4 : class Authenticator { 5 : /// Creates an Authenticator 6 1 : Authenticator( 7 : openid.Client client, { 8 : required Function(String) urlLauncher, 9 : Iterable<String> scopes = const [], 10 : Uri? redirectUri, 11 1 : }) : _authenticator = openid.Authenticator( 12 : client, 13 : scopes: scopes, 14 : redirectUri: redirectUri, 15 : urlLancher: urlLauncher, 16 : ); 17 : 18 : final openid.Authenticator _authenticator; 19 : 20 : /// Authorizes the client 21 1 : Future<openid.Credential?> authorize() { 22 2 : return _authenticator.authorize(); 23 : } 24 : 25 : /// Process a Response retrieved from an outside Authentication. 26 : /// For Example if the App was reopened by a Auth Redirect Link 27 1 : Future<void> processResult(Map<String, String> result) async { 28 2 : await openid.Authenticator.processResult(result); 29 : } 30 : }