init method

Future init()

Initialisation function. Only to be called once on startup or first usage of auth service. @param authorityOverride A override for the authority to use while initiating. This should be used when user previously logged in using a different authority to null such as when signing in with different userflows, such as seperate flows for different social providers

Implementation

Future init() async {
  await _initPca(defaultAuthority);
  //store the default scopes for the app
  try {
    await acquireTokenSilently();
    _authenticationStatusSubject.add(AuthenticationStatus.authenticated);
  } on Exception catch(e) {
    log(e.toString());
    print(
        "Default init signin failed. USer not signed in to default authority.");
    _authenticationStatusSubject.add(AuthenticationStatus.unauthenticated);
  }
}