Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Identity Server 4 Sign-in with desktop/mobile apps

We have a .Net Core Identity Server, a .Net Core Api, our clients however are desktop and mobile apps.

Looking through the docs it seems our Users need to Sign-in using Hybrid flow, however it seems this flow is for Web browser apps.

What is the correct flow/grant_type to Authenticate my Desktop Users and give them access to the Api?

like image 972
tinmac Avatar asked Mar 30 '17 14:03

tinmac


People also ask

How do I log into my identity server?

Login WorkflowYou must inform IdentityServer of the path to your login page via the UserInteraction settings on the options (the default is /account/login ). A returnUrl parameter will be passed informing your login page where the user should be redirected once login is complete.

What is redirect URI in IdentityServer4?

the allowed interactions with the token service (called a grant type) a network location where identity and/or access token gets sent to (called a redirect URI)

Do I need IdentityServer4?

Why do we need IdentityServer4? ASP.NET Identity can receive a security token from a third-party login provider like Facebook, Google, Microsoft and Twitter. But If you want to issue a security token for a local ASP.NET Identity user you need to work with a third-party library like IdentityServer4, OpenIddict.

How do I authorize API in NET Core?

Require authorization on a new API By default, the system is configured to easily require authorization for new APIs. To do so, create a new controller and add the [Authorize] attribute to the controller class or to any action within the controller.


1 Answers

Hybrid flow is correct. See this spec:

https://datatracker.ietf.org/doc/html/draft-ietf-oauth-native-apps-09

You can use this library: https://github.com/IdentityModel/IdentityModel.OidcClient2

and here are some sample: https://github.com/IdentityModel/IdentityModel.OidcClient.Samples

like image 197
leastprivilege Avatar answered Oct 12 '22 13:10

leastprivilege