Andy
Andy

Reputation: 30418

Redirect URL not getting called when authenticating using Xamarin.Auth

I am starting to build an app that authenticates to a third party web service, and I'm having problems getting the authentication working. The login page is displayed correctly, but once the user logs in an error message is displayed: "The URL can't be shown".

I'm working on the iOS version of my app first, so I've only tested this on iOS so far using the Simulator. I initially thought that I wasn't registering the URL scheme for the redirect URL correctly, but if I put a breakpoint in AppDelegate.OpenURL(), and enter a URL with my URL scheme in Safari my app is launched.

Handling the OAuth2Authenticator.Error event didn't give any more information beyond the same error message.

This is my first time working with Xamarin Forms and Xamarin Auth, so I'm not sure what else to do in order to debug the problem. What else can I do in order to figure out the root cause of this error?

Upvotes: 0

Views: 526

Answers (1)

Andy
Andy

Reputation: 30418

Turns out this was due to user error.

The redirect URL I was using didn't match the redirect URL I registered with the web service. Once I made them the same, the redirect URL worked as expected.

Upvotes: 0

Related Questions