I have two sites - a site on which users register and manage their account and a site on which there is no user interface, and nothing more than an API for storing and retrieving content. Both of these sites use the same Owin ASP.Net Identity 2.0 configuration. The UI site uses cookies for obvious reasons, and the API site uses carrier tokens. I need to be able to call API methods / URLs from a user interface site with current user authentication. In short, I need to create a valid Bearer token on the user interface site in order to add Rest Rest calls to the HTTP headers.
I was looking for a way to use "trusted" client authentication and call the Token API URL to create a Bearer token, or since both sites use the same code, and the user table calls the Owin method to generate the Toner media in the code of the user interface sites, which I can pass to the API headers, and the API site sees it as a valid token.
If you need more information, just let me know.
Update: Please see the updated answer below with the correct way to do this using the implicit oAuth stream.
owin asp.net-web-api2 asp.net-identity-2 bearer-token
John c
source share