How do I return multiple identities in a token with Thinktecture.IdentityServer.45?

368 views Asked by At

In the Thinktecture.IdentityModel.45 library, I can get a Microsoft.IdentityModel.Claims.ClaimsIdentityCollection by executing something like this:

 Dim handler = New JsonWebTokenHandler()
 handler.Configuration = config ' set elsewhere
 Dim identities = handler.ValidateToken(handler.ReadToken(token))

We have a system where a user gets to login and then choose an organizational context they are part of. Each context should be representative of what is available in the token (one identity per organization with a collection of specific claims). How can I get the Thinktecture.IdentityServer.45 to return a token that contains multiple identities?

1

There are 1 answers

1
leastprivilege On

WIF is generally not designed for this. And only certain token types support this at all.