Token persististence #2
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tokens are not persistent across restarts of the system. They should be, especially refresh tokens, as they are meant to have a longer life-time. While the access and id tokens are JSON Web Tokens (JWT) and can therefore still be verified using the public keys, refresh tokens are not. It is also not ideal that public key verification and token introspection give different results.
The reason for this is that the default OAuth2AuthorizationService which is what persists tokens is InMemoryOAuth2AuthorizationService.
I have tried to switch it to a JdbcOAuth2AuthorizationService with the corresponding schema (with the
blob
columns changed totext
). However, after doing so there are a lot of Jackson (de-)serialization errors that prevent it from working.So the alternative seems to be to write our own OAuth2AuthorizationService but, given that the main method is
save(OAuth2Authorization)
and OAuth2Authorization has an attribute defined asMap<String, Object>
that makes it rather tricky to persist.