I'm working on this Spring
Security implementation with OAuth2
and JWT
:
According to the author I can access resources using token this way:
To access a resource use (you'll need a different application which has configured ResourceServer):
http localhost:8080/users 'Authorization: Bearer '$ACCESS_TOKEN
About this step:
To use the refresh token functionality:
http --form POST adminapp:password@localhost:9999/oauth/token grant_type=refresh_token refresh_token=$REFRESH_TOKEN
It's not clear for me that when I have to refresh the token and how can I handle this part into my Angular
app.
Do I need to implement a timer which would refresh the token from time to time or is there another way to implement this functionality?