-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
TODO: JWT Auth.
Use JJWT along with Spring security. We keep all the currently implemented security code and logic structure, but implement a new custom AuthenticationManager that handles JSON Web Tokens.
This is quite straight forward when using JJWT. The required implementation is:
- A
TokenConfigthat can handle parsing config fields fromapplication.config - A
Filterfor theHttpSecuritybuilder inSecurityConfig. This extendsUsernamePasswordAuthenticationFilterfrom Spring and replaces the default authentication manager that Spring autowires.- In the example from Amigoscode, a class for
AuthenticationRequests is used along with this, to create anAuthenticationTokenAuthenticationobject that is sent to theAuthenticationManagerduring the validation process.
- In the example from Amigoscode, a class for
- A
OncePerRequestFilterto handle token verification logic (TokenVerifier). The bulk of this class will be using API from JJWT, and will be used in theHttpSecurityconfig to handle verification of the tokens attached to incoming requests.
Reading:
jwt.io: JWT Introduction
jjwt@github
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels