in wwauth/Google.Solutions.WWAuth/Adapters/ServiceAccountAdapter.cs [217:247]
public async Task<ISubjectToken> IntrospectTokenAsync(
string accessToken,
CancellationToken cancellationToken)
{
try
{
this.logger.Info("Introspecting access token");
using (var client = CreateHttpClient())
using (var response = await client.GetAsync(
new Uri("https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=" + accessToken),
cancellationToken)
.ConfigureAwait(false))
{
response.EnsureSuccessStatusCode();
var body = await response.Content
.ReadAsStringAsync()
.ConfigureAwait(false);
return new TokenInfo(
accessToken,
JsonConvert.DeserializeObject<Dictionary<string, object>>(body));
}
}
catch (HttpRequestException e)
{
throw new TokenExchangeException(
"Token introspection failed", e);
}
}