Identityserver4: Manual token creation

Created on 6 Mar 2016  路  2Comments  路  Source: IdentityServer/IdentityServer4

Hello, I've integrated usage of identity server to my project according to samples. Everything works like a charm :). Then, I faced with next challenge - I have tests which call API in self-hosted server. Once I add authentication to protect resources, I need to pass the token in header for each test.

Is there any way in which I can generate access token without going through full authentication flow (I want to do this only when IsDevelopment() == true, for testing purposes only) with some basic claims like id/name?

question

All 2 comments

you can create the tokens yourself (using the MS JWT lib) - or in-memory host idsrv. Check our integration tests for an example.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

createroftheearth picture createroftheearth  路  3Comments

user1336 picture user1336  路  3Comments

wangkanai picture wangkanai  路  3Comments

krgm03 picture krgm03  路  3Comments

ekarlso picture ekarlso  路  3Comments