예제 #1
0
        /// <summary>
        /// Creates new ClientCredentialsGrantTokenClient
        /// </summary>
        /// <param name="tokenEndpointUri">OAuth2 Token endpoint URI</param>
        /// <param name="clientCredentials">OAuth2 client credentials</param>
        public ClientCredentialsGrantTokenClient(string tokenEndpointUri, IClientCredentials clientCredentials)
        {
            if (_cache == null)
            {
                _cache = new InMemoryCache <string>();
            }

            const string grantType = "client_credentials";

            _customGrantTokenClient = new CustomGrantTokenClient(tokenEndpointUri, clientCredentials, grantType);
            _partialCacheKey        = string.Join(":", tokenEndpointUri, clientCredentials.CredentialThumbprint, grantType);
        }
예제 #2
0
 /// <summary>
 /// Creates new ResourceScopedAccessGrantTokenClient
 /// </summary>
 /// <param name="tokenEndpointUri">OAuth2 Token endpoint URI</param>
 /// <param name="clientCredentials">OAuth2 client credentials</param>
 public ResourceScopedAccessGrantTokenClient(string tokenEndpointUri, IClientCredentials clientCredentials)
 {
     _customGrantTokenClient = new CustomGrantTokenClient(tokenEndpointUri, clientCredentials, "urn:scalepoint:params:oauth:grant-type:resource-scoped-access");
 }