UserAuthorizer is discarding the id_token after successful authorization code exchange #821
Labels
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
I'm trying to get data from the
id_token
which is returned when exchanging an authorization code with the token endpoint.I have everything I need to make the request to the endpoint manually. However, this is very verbose and feels like re-inventing the wheel. It got me thinking that there must be a way to get this data using the classes provided by the library.
Currently I am using the
com.google.auth.oauth2.UserAuthorizer
class to build up a request for the exchange of information.The internals of
getCredentialsFromCode()
parses the response and it contains all the tokens. Including theid_token
but, it gets discarded when constructing theUserCredentials
object further down.Regardless, I want to get this value so I can know basic information about the user such as their name, birthday and email address from a single request.
There does exist a method called
idTokenWithAudience()
which returns a Google ID Token from the refresh token response. If I call this, I get a token back that doesn't contain all the data that was available in the identically namedid_token
mentioned earlier making it a no-go either.The text was updated successfully, but these errors were encountered: