public async Task IntrospectTokenAsync()

in wwauth/Google.Solutions.WWAuth/Adapters/StsAdapter.cs [144:181]


        public async Task<ISubjectToken> IntrospectTokenAsync(
            string accessToken,
            CancellationToken cancellationToken)
        {
            try
            {
                using (var service = CreateService())
                {
                    var response = await service.V1
                        .Introspect(
                            new GoogleIdentityStsV1IntrospectTokenRequest()
                            {
                                Token = accessToken,
                                TokenTypeHint = "urn:ietf:params:oauth:token-type:access_token"
                            })
                        .WithCredentials<
                            Google.Apis.CloudSecurityToken.v1.V1Resource.IntrospectRequest,
                            GoogleIdentityStsV1IntrospectTokenResponse>(this.clientSecrets)
                        .ExecuteAsync(cancellationToken)
                        .ConfigureAwait(false);

                    this.logger.Info("Successfully introspected token");

                    return new TokenInfo(accessToken, response);
                }
            }
            catch (GoogleApiException e)
            {
                //
                // Try to convert the exception.
                //
                var tokenException = TokenExchangeException.FromApiException(e);

                this.logger.Error(tokenException, "{0}", tokenException.Message);

                throw tokenException;
            }
        }