コード例 #1
0
ファイル: OauthApiKeyApi.cs プロジェクト: Clancey/SimpleAuth
		/// <summary>
		/// Initializes a new instance of the <see cref="T:SimpleAuth.OauthApiKeyApi"/> class.
		/// </summary>
		/// <param name="identifier">This is used to store and look up credentials/cookies for the API</param>
		/// <param name="apiKey">API key.</param>
		/// <param name="authKey">Auth key.</param>
		/// <param name="authLocation">Auth location.(Header or Query)</param>
		/// <param name="authenticator">OAuth Authenticator.</param>
		/// <param name="handler">Handler.</param>
		public OauthApiKeyApi(string identifier, string apiKey, string authKey, AuthLocation authLocation , OAuthAuthenticator authenticator, HttpMessageHandler handler = null) : base(identifier, authenticator, handler)
	    {

			AuthLocation = authLocation;
			AuthKey = authKey;
		    ApiKey = apiKey;
	    }
コード例 #2
0
ファイル: ApiKeyApi.cs プロジェクト: Clancey/SimpleAuth
		public static Task<string> PrepareUrl(Uri baseAddress, string path,string apiKey, string authKey, AuthLocation authLocation)
		{

			var url = baseAddress != null ? new Uri(baseAddress, path.TrimStart('/')) : new Uri(path);

			return Task.FromResult(url.AddParameters(authKey, apiKey).AbsoluteUri);

		}
コード例 #3
0
        public OauthApiKeyApi(string identifier, string apiKey, string authKey, AuthLocation authLocation, string clientId, string clientSecret, string tokenUrl, string authorizationUrl, string redirectUrl = "http://localhost", HttpMessageHandler handler = null) : base(identifier, clientId, clientSecret, handler)
        {
            this.TokenUrl = tokenUrl;
            authenticator = new OAuthAuthenticator(authorizationUrl, tokenUrl, redirectUrl, clientId, clientSecret);

            AuthLocation = authLocation;
            AuthKey      = authKey;
            ApiKey       = apiKey;
        }
コード例 #4
0
ファイル: OauthApiKeyApi.cs プロジェクト: Clancey/SimpleAuth
		/// <summary>
		/// Initializes a new instance of the <see cref="T:SimpleAuth.OauthApiKeyApi"/> class.
		/// </summary>
		/// <param name="identifier">This is used to store and look up credentials/cookies for the API</param>
		/// <param name="apiKey">API key.</param>
		/// <param name="authKey">Auth key.</param>
		/// <param name="authLocation">Auth location.(Header or Query)</param>
		/// <param name="clientId">OAuth Client identifier.</param>
		/// <param name="clientSecret">OAuth Client secret.</param>
		/// <param name="tokenUrl">URL for swaping out the token.</param>
		/// <param name="authorizationUrl">Login website URL.</param>
		/// <param name="redirectUrl">Redirect URL. Defaults to http://localhost</param>
		/// <param name="handler">Handler.</param>
		public OauthApiKeyApi(string identifier,string apiKey,string authKey, AuthLocation authLocation, string clientId, string clientSecret, string tokenUrl, string authorizationUrl, string redirectUrl = "http://localhost", HttpMessageHandler handler = null) : base(identifier, clientId, clientSecret, handler)
		{
			this.TokenUrl = tokenUrl;
			authenticator = new OAuthAuthenticator(authorizationUrl, tokenUrl, redirectUrl, clientId, clientSecret);

			AuthLocation = authLocation;
			AuthKey = authKey;
			ApiKey = apiKey;
		}
コード例 #5
0
ファイル: ApiKeyApi.cs プロジェクト: Clancey/SimpleAuth
		public ApiKeyApi(string apiKey, string authKey, AuthLocation authLocation, HttpMessageHandler handler = null)
			: base(apiKey, apiKey, handler)
		{
			AuthLocation = authLocation;
			AuthKey = authKey;
		}
コード例 #6
0
 public OauthApiKeyApi(string identifier, string apiKey, string authKey, AuthLocation authLocation, OAuthAuthenticator authenticator, HttpMessageHandler handler = null) : base(identifier, authenticator, handler)
 {
     AuthLocation = authLocation;
     AuthKey      = authKey;
     ApiKey       = apiKey;
 }
コード例 #7
0
ファイル: ApiKeyApi.cs プロジェクト: snavatta/SimpleAuth
 public ApiKeyApi(string apiKey, string authKey, AuthLocation authLocation, HttpMessageHandler handler = null)
     : base(apiKey, apiKey, handler)
 {
     AuthLocation = authLocation;
     AuthKey      = authKey;
 }
コード例 #8
0
ファイル: ApiKeyApi.cs プロジェクト: snavatta/SimpleAuth
        public static Task <string> PrepareUrl(Uri baseAddress, string path, string apiKey, string authKey, AuthLocation authLocation)
        {
            var url = baseAddress != null ? new Uri(baseAddress, path.TrimStart('/')) : new Uri(path);

            return(Task.FromResult(url.AddParameters(authKey, apiKey).AbsoluteUri));
        }