Hello all,
I want to prompt the user to log in with their ArcGIS Online account when my app starts up. I get their login information and load the Portal, which causes an authenitcationChallenge signal to be called by an AuthenticationManager. So, I connect to the signal and pass it the username and password, and it works fine if they enter the correct information. The problem is when they enter in invalid login information, it fails to load the Portal, and when the user puts in the correct login information, I do a retryLoad() on the Portal, and it fails because the authenticationChallenge doesn't get called. Also, it gives me the error that too many invalid logins have been attempted, but I am sure the issue is that I am not sble to pass the Portal the correct username and password because the authenticationChellenge doesn't ever come up after the first load of the Portal.
Does anyone know how I could get the authenticationChallenge to come back after the first Portal load attempt? Any help would be appreciated.
Thanks,
Keith
Solved! Go to Solution.
Hi Keith,
I am not sure if this will help, you can try to cancel authentication challenge before opening a new OAuth login page
AuthenticationView {
id: authenticationView
authenticationManager: AuthenticationManager
}
authenticationView.authChallenge.cancel(); We also have two samples related to Portal log in. You can search for "OAuth + Biometric Authentication" and "Portal User Info" in the AppStudio Desktop New App dialog
Hello Keith,
Have you looked at our sample our implementation for Portal login (OAuth2) implementation in one of our templates?
For examples in MapViewer template, you can look at
You should be able to follow how to handle such scenarios when someone fails to login.
Thank you,
Erwin
Thanks for your reply. I got it working with the AuthenticationView, so all is good now.
Hi Keith,
I am not sure if this will help, you can try to cancel authentication challenge before opening a new OAuth login page
AuthenticationView {
id: authenticationView
authenticationManager: AuthenticationManager
}
authenticationView.authChallenge.cancel(); We also have two samples related to Portal log in. You can search for "OAuth + Biometric Authentication" and "Portal User Info" in the AppStudio Desktop New App dialog
Ok, thanks. I wasn't using the AuthenticationManager before because I hadn't imported Esri.ArcGISRuntime.Toolkit.Dialogs. I was able to get it to work with the AuthenticationView though, so all is good. Thanks again.