I am developing a web api for use with IdentityServer3.
I have the server and the web api running, but I am having trouble figuring out how to have users login from a mobile app to the server.
My question is this: if I have implicit flow enabled for the identity server, how do users sign in from a tool like fiddler to receive their tokens upon successful authentication?
I know that the token endpoint is:
https://myidservername/identity/connect/token
I also know that the authorization endpoing is: https://myidservername/identity/connect/authorization
But where do users sign in? Do I have to create my own view for users to be able to pass a username and password and receive a token? More specifically, my question is how to sign in from fiddler, not from a dedicated view that I would have to render to users.
IdentityServer is an all-in-one OpenID+OAuth 2 implementation, for this reason Implicit Flow is entirely handled by IdentityServer itself using the authorize endpoint as a bridge between an authentication request and the token issuing process.
The nature of Implicit Flow does not allow clients such as Fiddler (more precisely, clients that cannot render directly a web page) to authenticate. To further understand why I will try to reproduce the steps of OAuth Implicit grant in a Web API/IdentityServer scenario:
Authorize
)Authorization
header and validating its content)WebView
/UIWebView
in a mobile app, opening a pop-up inside the browser, etc.)As you can see, you have no way to authenticate a client that cannot inherently render the login page returned in step 4. For those class of clients Resource Owner Credentials Flow may be a better solution.
You need to enable such grant for your client inside IdentityServer configuration (you may follow this tutorial to find out how), and then craft a request for the token endpoint setting grant_type
to password
and providing all other required parameters.