AngularSPAWebAPI | Angular Single Page Application with an ASP.NET | Authentication library
kandi X-RAY | AngularSPAWebAPI Summary
kandi X-RAY | AngularSPAWebAPI Summary
Angular Single Page Application with an ASP.NET Core Web API that uses token authentication
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of AngularSPAWebAPI
AngularSPAWebAPI Key Features
AngularSPAWebAPI Examples and Code Snippets
Community Discussions
Trending Discussions on AngularSPAWebAPI
QUESTION
I have created ASP.NET Core WebApi protected with IdentityServer4 using ROPC flow (using this example: https://github.com/robisim74/AngularSPAWebAPI).
How to manually generate access_token from the server without password?
...ANSWER
Answered 2017-May-31 at 10:27Further to my comment on your original question. Implement an impersonation feature within the implicit/hybrid flow. If a user is determined to be a "super admin" then present them with an additional step after authentication that lets them enter/select the account they wish to impersonate. Once that's done simply establish the session on the identity server as the selected user (and possibly store additional claims denoting that it is an impersonated session and who is doing the impersonation). Any tokens will then be issued as if you were that user and all without having to know the password.
Additionally if you wish to create tokens yourself have a look at the ITokenCreationService provided by IdSrv4. You can inject that into your own controller/service/whatever and use CreateTokenAsync(Token token) to generate a signed JWT with any claims you like.
QUESTION
I have SPA app that uses IdentityServer4 ROPC flow for auth with access and refresh tokens from this example https://github.com/robisim74/AngularSPAWebAPI. Every 15 minutes I update refresh_token for a new pair of refresh and access tokens.
However If I restart IdentityServer4 app old refresh_tokens issued before restart no longer valid. How to fix it? I suspect I should implement some interface to store issued refresh tokens?
...ANSWER
Answered 2017-Jun-05 at 09:28You need to implement persisted grants by using the IPersistedGrantStore
contract. This stores things like refresh_tokens into a defined persistence. By default IdentityServer 4 will use an InMemory persistence store, which is why you keep on losing your refresh_token references when you restart the application.
It is pretty much mandatory to have a persistence layer for this in production if you are going to be using refresh_tokens.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install AngularSPAWebAPI
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page