Base solution for your next web application
Open Closed

Can I login to aspnetzero from Xamarin app? #2728


User avatar
0
bilalhaidar created

Hi, I am planning to develop a simple app in Xamarin. I need to connect to the same database as my web app. Also, I want to authenticate my users against the same DB using same AppServices, etc.

Is this possible? Any helpful examples or documentation on this topic please?


5 Answer(s)
  • User Avatar
    0
    AndrewT created

    I am also interested in this.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    We don't have an example for this yet but it should be similar to use rest api from Google Chrome's postman. In order to check it, open the document <a class="postlink" href="https://aspnetzero.com/Documents/Development-Guide">https://aspnetzero.com/Documents/Development-Guide</a>, select your project's type and in the following document go to section TOKEN BASED AUTHENTICATION.

    In the Xamarin app, basically, first you need to get an access token as explained in TOKEN BASED AUTHENTICATION section of above document.

    Then, in your each reqeust from Xamarin app to rest api, include this token just like the example abo shows for postman to retrieve user list.

    Thanks.

  • User Avatar
    0
    bilalhaidar created

    Ah great. So I can authenticate my users through the framework WebApi Controllers? So I wont re-create any code, just use the existing?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Yes, it should work in that way.

  • User Avatar
    0
    bilalhaidar created

    Thanks I will give it a try some time soon.