コード例 #1
0
 public UserCredentials(string username, string api_access_key, AuthUrl authUrl)
 {
     this.username = username;
     this.api_access_key = api_access_key;
     this.authUrl = authUrl == utils.AuthUrl.UK
         ? new Uri(Constants.UK_AUTHURL) : new Uri(Constants.US_AUTHURL);
 }
コード例 #2
0
 public UserCredentials(string username, string api_access_key, AuthUrl authUrl)
 {
     this.username       = username;
     this.api_access_key = api_access_key;
     this.authUrl        = authUrl == utils.AuthUrl.UK
         ? new Uri(Constants.UK_AUTHURL) : new Uri(Constants.US_AUTHURL);
 }
コード例 #3
0
    public override string ToString()
    {
        var  sb      = new StringBuilder("AgeCheckRequestResult(");
        bool __first = true;

        if (AuthUrl != null && __isset.authUrl)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("AuthUrl: ");
            AuthUrl.ToString(sb);
        }
        if (SessionId != null && __isset.sessionId)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("SessionId: ");
            SessionId.ToString(sb);
        }
        sb.Append(")");
        return(sb.ToString());
    }
コード例 #4
0
    public override string ToString()
    {
        var  sb      = new StringBuilder("AgeCheckDocomoResult(");
        bool __first = true;

        if (AuthUrl != null && __isset.authUrl)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("AuthUrl: ");
            AuthUrl.ToString(sb);
        }
        if (__isset.userAgeType)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("UserAgeType: ");
            UserAgeType.ToString(sb);
        }
        sb.Append(")");
        return(sb.ToString());
    }
コード例 #5
0
 public void ValidateOptions()
 {
     ClientId.ThrowConfigurationExceptionIfNull($"{Position}:{ClientId}");
     Secret.ThrowConfigurationExceptionIfNull($"{Position}:{Secret}");
     AuthUrl.ThrowConfigurationExceptionIfNull($"{Position}:{AuthUrl}");
     EmailUrl.ThrowConfigurationExceptionIfNull($"{Position}:{EmailUrl}");
     SenderEmail.ThrowConfigurationExceptionIfNull($"{Position}:{SenderEmail}");
     SenderName.ThrowConfigurationExceptionIfNull($"{Position}:{SenderName}");
 }
コード例 #6
0
ファイル: TokenManager.cs プロジェクト: Alkrun/Eve-OpenAPI
        /// <summary>
        /// Creates a token from the SSO response
        /// </summary>
        /// <param name="response"></param>
        /// <param name="authUrl"></param>
        /// <param name="scope"></param>
        /// <returns></returns>
        async Task <IOauthToken> GetToken(IAuthResponse response, AuthUrl authUrl, IScope scope)
        {
            var tokenRequest  = GetTokenRequest(response.Code, authUrl.CodeVerifier);
            var tokenResponse = await client.SendAsync(tokenRequest);

            string json = await tokenResponse.Content.ReadAsStringAsync();

            return(tokenFactory.FromJson(json, scope));
        }
コード例 #7
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.authUrl)
            {
                hashcode = (hashcode * 397) + AuthUrl.GetHashCode();
            }
            if (__isset.sessionId)
            {
                hashcode = (hashcode * 397) + SessionId.GetHashCode();
            }
        }
        return(hashcode);
    }
コード例 #8
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.authUrl)
            {
                hashcode = (hashcode * 397) + AuthUrl.GetHashCode();
            }
            if (__isset.userAgeType)
            {
                hashcode = (hashcode * 397) + UserAgeType.GetHashCode();
            }
        }
        return(hashcode);
    }
コード例 #9
0
ファイル: TokenManager.cs プロジェクト: Alkrun/Eve-OpenAPI
        public async Task <(IOauthToken token, string owner)> GetToken(IScope scope)
        {
            AuthUrl       authUrl  = GenerateAuthUrl(scope.ScopeString);
            IAuthResponse response = await responseManager.GetResponse(authUrl.Url, 10000);

            if (authUrl.State != response.State)
            {
                throw new Exception("Invalid auth response state.");
            }

            IOauthToken token = await GetToken(response, authUrl, scope);

            IJwtToken jwtToken = await validationManager.ValidateTokenAsync(token);

            return(token, jwtToken.Name);
        }
コード例 #10
0
        public ClientCredentials GetClientCredentials(string client_id, string client_secret)
        {
            ClientCredentials ret = null;

            try
            {
                ret = AuthUrl.PostUrlEncodedAsync(new { client_id, client_secret, scope = "payments", grant_type = "client_credentials" }).ReceiveJson <ClientCredentials>().Result;
            }
            catch (FlurlHttpException e)
            {
                Debug.WriteLine(e.Message);
            }
            catch (Exception e1)
            {
                Debug.WriteLine(e1.Message);
            }
            return(ret);
        }
コード例 #11
0
ファイル: TokenManager.cs プロジェクト: Alkrun/Eve-OpenAPI
        public async Task <(IOauthToken token, string owner)> ListenForResponse(IScope scope, AuthUrl authUrl)
        {
            IAuthResponse response = await responseManager.AwaitResponse(20000);

            if (authUrl.State != response.State)
            {
                throw new Exception("Invalid auth response state.");
            }

            IOauthToken token = await GetToken(response, authUrl, scope);

            IJwtToken jwtToken = await validationManager.ValidateTokenAsync(token);

            return(token, jwtToken.Name);
        }