OAuth2
OAuth2 copied to clipboard
Automatic login after successful OAuth2PasswordGrant
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.