Redirect URL for google oauth?

CodyRousseauCodyRousseau USUniversity ✭✭

Hello,

Does anyone know the default redirect url for google oauth? I have tried logic based on this github link(line 18):

https://github.com/xamarin/xamarin-forms-samples/blob/master/WebServices/OAuthNativeFlow/OAuthNativeFlow/Constants.cs

and that does not work. Any ideas?

Thanks!

Tagged:

Answers

  • RobStellerRobSteller USMember ✭✭

    Were you able to figure this out?

  • CodyRousseauCodyRousseau USUniversity ✭✭

    @RobSteller
    I was using "xamarin-auth://localhost" as the redirecut url, but I ended up not implementing the functionality and instead used Auth0 for my login flow.

    https://auth0.com/

  • RobStellerRobSteller USMember ✭✭

    Thanks!

  • moljacmoljac HRBeta ✭✭✭

    xamarin-auth://localhost is indeed custom url, but it can be used (with google) only with "Other" app/client type.

    You must read google docs during setup of the OAuth provider - for Android it has 2 options (based on package id from AndroidManifest.xml and google product id - the second one works the best). IOS has different setup (Info.plist and any kind of scheme). If you add UWP to that you will have new issues, but solvable. The same is valid for Xamarin.Forms.

    Basically it is not trivial and needs some planing.

  • BrunoPasquini.7813BrunoPasquini.7813 AGMember ✭✭

    I am trying to use "com.googleusercontent.apps.5**************"; as a redirect url but it can not be converted to an uri and use it in the OAuth2Authenticator.

  • KlinguKlingu USMember

    @BrunoPasquini.7813 said:
    I am trying to use "com.googleusercontent.apps.5**************"; as a redirect url but it can not be converted to an uri and use it in the OAuth2Authenticator.

    You should add ":/oauth2redirect" at the end of your redirectUrl. Like below ;-)

    "com.googleusercontent.apps.5-a-long-identifier-88:/oauth2redirect"

    Allmost there ;-)

Sign In or Register to comment.