I am still working through authentication using Okta on my xamarin forms app. I believe I have am not using the correct Redirect URI in the OAuth2Authenticator constructor below. Although I appear able to enter my Okta credentials, I do not return to the mobile app. instead I sit on the Okta developer webpage (the Login_redirect_URIs) property below. I have tried changing it to another (random) website, and it makes no difference. When I press the back button, I receive a AuthenticatorCompletedEventArgs.IsAuthenticated == false result.
What should I be passing in for the Login_redirect_URIs value?
From my xamarin app loginViewModel.cs page I am using the above as follows;
Scopes = “openid, email”
var authenticator = new OAuth2Authenticator(ClientID,
Scopes,
new Uri(Okta_domain),
new Uri(Login_redirect_URIs),
null,
false);
var Presenter = new Xamarin.Auth.Presenters.OAuthLoginPresenter();
Presenter.Login(authenticator);
authenticator.Completed += OktaAuthenticator_Completed;
Hi @Lenny! For Android, you’ll need the IntentFilter. The DataScheme in the Android IntentFilter should match what you have registered in his Okta Dashboard.
For iOS, you’ll need to register the URIs as custom url types in your Info.plist. And then in your appdelegate implementation you’ll need to override the OpenUrl method to determine what to do with the callback when your users get redirected back to your app.
Did you get this working?
I have the exactly the same problem, the Okta login page appears, I login but it does not return to my app, but instead, redirects to my okta dashboard???