by smashed · 5y ago · 0 comments
https://datatracker.ietf.org/doc/draft-ietf-httpbis-message-...
Library support for it is spotty, depending on your framework of choice but they exists.
Your second approach is covered by oAuth refreshable tokens I believe.
I went through the same process as you in an API project, eventually ended up using Keycloak as the auth server.
As for the second approach, yes exactly it's very similar to OAuth2. In fact I guess this is the method used by GCP APIs by service accounts. The clients use their long-lived secrets to get an oauth2 access token, this access token is JWT I guess that also contains authorization information such as scopes.