AVEbrahimi
AVEbrahimi

Reputation: 19184

Authenticating Asp.NET CORE web application from Xamarin

I have a ASP.NET Core web application, having builtin authentication.

How can I authenticate Xamarin native mobile app with web app and use web services?

Is there any Xamarin library for authenticating Microsoft Identity Server?

I found an article describing creating web service backend in ASP.NET core, but it omitted authentication (why?) :

https://learn.microsoft.com/en-us/aspnet/core/mobile/native-mobile-backend

Upvotes: 4

Views: 2219

Answers (2)

xleon
xleon

Reputation: 6375

There´s no Xamarin client for Microsoft Identity Server per se, but you can use oAuth2. It´s pretty standard.

Implementing an oAuth2 server like OpenIddict, IdentityServer or AspNet.Security.OpenIdConnect.Server you can use any oAuth2 client to authenticate, either way from a javascript application or Xamarin.

For Xamarin/.NET clients, there is an awesome client (PCL) called IdentityModel.

Upvotes: 3

Ilya Sulimanov
Ilya Sulimanov

Reputation: 7846

In the article they use Web API template, problem is that ASP.NET Core does support personal authentication from a box (at least for right now)

Take a look at this project OpenIddict. It's really easy to use and thay have a lot of examples how to build your own authentication service based on ASP.NET Core Web API. There is only one drawback of this project (by my opinion) - from the box OpenIddict supports only EF Core as data access library, but you can implement your own provider.

Upvotes: 3

Related Questions