Todoist Xamarin Auth Authentication

Hello everyone,
I'm trying to authenticate my app with Todoist using Xamarin auth and I have everything working except the redirect url. I made this work with Google sign in because Google gives a redirect url to use with the app that doesn't start with "http", but todoist wants the redirect to start with "http". It is my understanding that this cannot work with Xamarin auth, so how would I go about choosing a redirect url that would work?

Thanks, Joe

Answers

  • jezhjezh Member, Xamarin Team Xamurai

    For this question, you can refer to the demo : https://github.com/xamarin/Xamarin.Auth

  • JoeFiotiJoeFioti USMember ✭✭

    @jezh said:
    For this question, you can refer to the demo : https://github.com/xamarin/Xamarin.Auth

    That is just the Xamarin.Auth package, that doesn't answer my question about the redirect URI. I don't know what to put as the redirect URI because todoist wants an http url but xamarin auth wants a custom one.

  • jezhjezh Member, Xamarin Team Xamurai

    Could you please post some code snippet, or p basic demo?

  • JohnHardmanJohnHardman GBUniversity mod

    I wonder if @moljac may be able to answer this?

  • JoeFiotiJoeFioti USMember ✭✭

    Here is the doc I based my code off of:
    https://docs.microsoft.com/en-us/xamarin/xamarin-forms/data-cloud/authentication/oauth

    Here is the code I use to define the Authenticator:
    public static OAuth2Authenticator todoistAuthenticator = new OAuth2Authenticator("clientID", "clientSecret", "data:read", new Uri("https://todoist.com/oauth/authorize"), new Uri("com.briefing.login/oauth2redirect"), new Uri("https://todoist.com/oauth/access_token"), null, true);

    And here is the IntentFilter I have on the activity that intercepts the redirect url:
    [IntentFilter(
    new[] { Intent.ActionView },
    Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable },
    DataSchemes = new[] { "com.briefing.login" },
    DataPath = "/oauth2redirect")]

    Notice my redirect uri path is the same in both and does not have Http in it. That is because when I put Http in it then the login fails because the redirect uri does not get intercepted by the activity, the browser just goes to a page claiming the webpage could not be found.

    This non-http redirect url doesn't work either though because any redirect uri used must be registered in the Todoist api, and todoist does not allow the registration of non-http uris.

  • FrancisGFrancisG Member ✭✭

    Having the same issue. This makes the Xamarin.Auth library pretty much useless with OpenID servers. Did you ever get this resolved?

Sign In or Register to comment.