IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Load Balance for IdSvr4

Open atpyk opened this issue 9 years ago • 7 comments

Implementing the interface "IPersistedGrantStore" that could persist RefreshToken, is there any way to store the Access Token, so that support Load Balance.

atpyk avatar Jan 03 '17 02:01 atpyk

You can use our EF implementation:

https://github.com/IdentityServer/IdentityServer4.EntityFramework/'

and

https://identityserver4.readthedocs.io/en/release/quickstarts/8_entity_framework.html

brockallen avatar Jan 03 '17 02:01 brockallen

Or do you mean you're not able to get access tokens to work in a load balanced setup?

brockallen avatar Jan 03 '17 02:01 brockallen

No, I haven't try, just concern. Because I don't know the way to store access tokens and don't know how to share the access tokens in multiple services.

I will try your solution, thanks.

atpyk avatar Jan 03 '17 02:01 atpyk

Access tokens can be in one of two formats: 1) JWT, or 2) Reference.

JWTs are self-contained and do not require persistence in IdentityServer. They can be sent to an API and the API can validate them without anything other then the signing key from IdentityServer.

Reference tokens are, as the name suggests, "references" to data stored in IdentityServer. To validate them the API needs to call back to IdentityServer, which will then check the database for the validity of the access token.

brockallen avatar Jan 03 '17 02:01 brockallen

What's the application scenarios for JWT?

In this case, we have one IdSvr, one web server that provides some web apis should be authorized by IdSvr, on client server need to be issued an access token by username and password, and then to talk with the web server to invoke web apis, if the IdSvr crash, that means the web server cannot validate access token(JWT). About the case of Load Balance. If we have two instances of IdSvr those run in different processes. One IdSvr issues an access token(JWT) to client side, then the client side call the other IdSvr to do validation, it will failed.

Regarding you said, the JWT cannot apply these scenarios, right?

atpyk avatar Jan 03 '17 03:01 atpyk

JWTs do not need IdentityServer to validate once the client app has the metadata, correct.

brockallen avatar Jan 03 '17 12:01 brockallen

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.

lock[bot] avatar Jan 15 '20 04:01 lock[bot]