WEB/Security

Lesson 16 - Using non-opaque tokens in Spring Security with JWT

Tony Lim 2022. 5. 10. 10:28
728x90

just like userDetailService exist for loading User credential

Client has ClientDetailService for loading Client crediential

 

to validate user we have user detailService

for client authentication

notice we are using tokenstore with covnerter -> we are storing access token made of JWT

if we don't specifiy tokenStore , just like previous lecture spring security will use default opaque token 

notice we are using our custom JpaClientDetailService to store client credential -> later when client request access token we will compare by loading cds method

it is recommanded to seperate Entitiy from ClientDetails

 

to check non-opaque token( in this case JWT) 

both servers need to have same key

Authentication Server encode with key and make jwt 

Resource server validate jwt with key 

728x90