/* Copyright 2015 Google Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ using System.Threading; using System.Threading.Tasks; namespace Google.Apis.Auth.OAuth2 { /// /// Allows direct retrieval of access tokens to authenticate requests. /// This is necessary for workflows where you don't want to use /// to access the API. /// (e.g. gRPC that implemenents the entire HTTP2 stack internally). /// public interface ITokenAccess { /// /// Gets an access token to authorize a request. /// Implementations should handle automatic refreshes of the token /// if they are supported. /// The might be required by some credential types /// (e.g. the JWT access token) while other credential types /// migth just ignore it. /// /// The URI the returned token will grant access to. /// The cancellation token. /// The access token. Task GetAccessTokenForRequestAsync(string authUri = null, CancellationToken cancellationToken = default(CancellationToken)); } }