2

I'm trying to recreate Azure CLI authentication using Identity Server. How can I do that?

I have a CLI which uses client from IdentityModel to access token to API in the name of the user sourced from external identity provider.

In Azure CLI the flow that interests me is following (roughly):

  1. az login displays address and some kind of clientId/authorization code (different every time)

  2. User types in the code and then log in to his Microsoft account and consents

  3. In the meantime console app seems to be polling endpoint and after user consents console app seems to obtain either refresh token or very long-lived access token because it has access to user subscriptions and he doesn't need to login every few hours

Does similar flow already exists in IdentityServer or can be added as an extension grant? And does it make sense to do that or should I use some other solution in addition to IdentityServer?

I've reviewed flows available in IdentityServer and it seems that no single one fits exactly my needs as I require something that is similar to Oauth 2.0 resource owner flow but with OpenId Connect intermediate stage where user can authenticate in browser.

EDIT: It seems that what I need is similar to oauth 2.0 device flow

EDIT2: Scott Brady is already working on adding device flow to Identity Server 4 issue

EDIT3: Also found OAuth 2.0 for Native Apps

Community
  • 1
  • 1
xmichaelx
  • 569
  • 1
  • 6
  • 17

0 Answers0