OAuth2 icon indicating copy to clipboard operation
OAuth2 copied to clipboard

Automatic login after successful OAuth2PasswordGrant

Open frederik-jacques opened this issue 5 years ago • 0 comments

Hi all,

I was wondering how you would do an automatic login when you have previously done a successful OAuth2PasswordGrant. I'm currently using the following code to show a custom login viewcontroller at launch

passwordGrant = OAuth2PasswordGrant(settings: settings)
passwordGrant.authConfig.authorizeContext = self
passwordGrant.delegate = self
        
do {
   print("$$ Authorizing")
   try passwordGrant.doAuthorize()
}
catch {
    print("$$ Error authorizing")
    print("$$ \(error.localizedDescription)")
}

But when I relaunch the app the login viewcontroller is shown again, because the email/password fields are empty.

frederik-jacques avatar Mar 16 '20 13:03 frederik-jacques