Closed seallard closed 8 months ago
I don't really see the point of encrypting the refresh tokens at rest since you still need the client secret to use it for anything. But I will do so anyway since it is a best practice outlined by google here.
We need to use the id token instead of the access token. We just want a token representing the users identity. There is no need for an access token. So /auth
will return an id token instead.
Add an endpoint in trailblazer called
/auth
supportingPOST
with a body containing a single field calledcode
(the authorization code).It should do the following
It is also necessary to add this callback endpoint to the allowed redirects for the OAuth client in google cloud. Google says it is necessary to encrypt tokens that are stored server side (source). I guess that makes sense in case of a data breach.
See this example implementation https://github.com/MomenSherif/react-oauth/issues/12#issuecomment-1131408898