We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

LSE's avatar
LSE
Explorer | Level 3
4 years ago

Login form not appear in my xamarin APP

A few days in my android App that uses Dropbox.Api (v. 4.9.4) when OAuth2Authenticator loads the login form, user and password fields are not displayed.

6 Replies

  • LSE's avatar
    LSE
    Explorer | Level 3
    4 years ago

    var auth = new OAuth2Authenticator(
    clientId: apikey, // your OAuth2 client id
    scope: "", // The scopes for the particular API you're accessing. The format for this will vary by API.
    authorizeUrl: authorizeUri, // the auth URL for the service
    redirectUrl: callbackUri,
    isUsingNativeUI: false); // the redirect URL for the service

     

    This represents at the moment how our "OAuth2Authenticator" is setted.
    By setting the parameter "isUsingNativeUI" to TRUE,  the GUI is correctly displayed (with pass and user filds) but I cannot intercept the opening of the redirect page and capture the token.

    I also tried to update to the latest version of the DropBox API but they had no impact

     

    Can someone help me?

     

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    4 years ago

    [Cross-linking for reference: https://stackoverflow.com/questions/70837899/dropbox-login-username-and-password-filds-hidden-xamarin-native ]

     

    Please note that the official Dropbox API v2 .NET SDK does not officially support Xamarin. Given that, and the version number you mentioned, it sounds like you're referring to the Xamarin.Dropbox.Api library, which is not owned or supported by Dropbox.

     

    In any case, Dropbox does not support processing the OAuth app authorization flow in a web view like OAuth2Authenticator apparently uses with your original configuration. The OAuth app authorization flow should be processed in the user's system browser. See here for more information.

     

    It sounds like using the "isUsingNativeUI" option might be sending it to a supported system browser? Please refer to the OAuth Guide and authorization documentation for information on using the OAuth flow, such as how to get the result from a redirect URI, for instance. For client-side apps, you should use the PKCE version.

  • LSE's avatar
    LSE
    Explorer | Level 3
    4 years ago

    At the moment, I'm able to show the login form correctly using an exthernal browser but I can't intercept the redirect URI, capture the token and use it.

     

    I have tried many solutions, but none of them allow me to complete the authentication phase correctly

     

    About OAuth flow-PKCE version, as you suggested, I have not found sufficient examples or documentation to develop a solution with it. 

     

    Can you help me whit this?
    Or link some examples in xamarin-android?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    4 years ago

    We don't have any specific resources or samples for Xamarin in particular unfortunately. I'll pass this along as a feature request but I can't promise if or when that might be implemented.

     

    The authorization flow is covered in the OAuth Guide and authorization documentation though. If something in the Dropbox API/OAuth flow isn't working as expected/documented, please share the details so we can take a look and investigate.

     

    The official Dropbox SDKs come with some working examples, such as for the official .NET and JavaScript SDKs, for instance:

  • OnCore's avatar
    OnCore
    Explorer | Level 3
    4 years ago

    I'm having the same issue.  I suspect something changed recently on the way the the Dropbox page is created.  This was working awhile back (not sure how long as the tokens were logging it in as expected).  After a logout and tried to log back in, the User & Password fields are missing and the page is drawn incorrectly.

  • OnCore's avatar
    OnCore
    Explorer | Level 3
    4 years ago

    Well whatever it was that got broken by DB is now Working again!  Out of nowhere the page is now displaying properly.  Pfew. 🙂

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 6 hours ago
410 Following

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!