Secure API using OAuth2 with refresh token workflow
When using the authorization code grant type to get the access token, you need to get the permission from the resource owners at least for the first time. In the subsequent attempts to get the access token, if you do not want to get the permission from the resource owners, then you can use the refresh token.
This use case explains how to secure the API using OAuth2 authentication strategy. It also explains the refresh token workflow in detail.