public void When_Passing_No_Parameter_Then_Empty_Result_Is_Returned()
        {
            // ARRANGE
            InitializeFakeObjects();

            // ACT
            var result = _authenticateInstructionGenerator.GetAuthenticateInstruction(null);

            // ASSERT
            Assert.True(string.IsNullOrWhiteSpace(result.ClientIdFromAuthorizationHeader));
            Assert.True(string.IsNullOrWhiteSpace(result.ClientSecretFromAuthorizationHeader));
        }
        private AuthenticateInstruction CreateAuthenticateInstruction(GetTokenViaTicketIdParameter authorizationCodeGrantTypeParameter, AuthenticationHeaderValue authenticationHeaderValue)
        {
            var result = _authenticateInstructionGenerator.GetAuthenticateInstruction(authenticationHeaderValue);

            result.ClientAssertion                 = authorizationCodeGrantTypeParameter.ClientAssertion;
            result.ClientAssertionType             = authorizationCodeGrantTypeParameter.ClientAssertionType;
            result.ClientIdFromHttpRequestBody     = authorizationCodeGrantTypeParameter.ClientId;
            result.ClientSecretFromHttpRequestBody = authorizationCodeGrantTypeParameter.ClientSecret;
            return(result);
        }
        private AuthenticateInstruction CreateAuthenticateInstruction(RefreshTokenGrantTypeParameter refreshTokenGrantTypeParameter, AuthenticationHeaderValue authenticationHeaderValue, X509Certificate2 certificate)
        {
            var result = _authenticateInstructionGenerator.GetAuthenticateInstruction(authenticationHeaderValue);

            result.ClientAssertion                 = refreshTokenGrantTypeParameter.ClientAssertion;
            result.ClientAssertionType             = refreshTokenGrantTypeParameter.ClientAssertionType;
            result.ClientIdFromHttpRequestBody     = refreshTokenGrantTypeParameter.ClientId;
            result.ClientSecretFromHttpRequestBody = refreshTokenGrantTypeParameter.ClientSecret;
            result.Certificate = certificate;
            return(result);
        }
        private AuthenticateInstruction CreateAuthenticateInstruction(
            RevokeTokenParameter revokeTokenParameter,
            AuthenticationHeaderValue authenticationHeaderValue)
        {
            var result = _authenticateInstructionGenerator.GetAuthenticateInstruction(authenticationHeaderValue);

            result.ClientAssertion                 = revokeTokenParameter.ClientAssertion;
            result.ClientAssertionType             = revokeTokenParameter.ClientAssertionType;
            result.ClientIdFromHttpRequestBody     = revokeTokenParameter.ClientId;
            result.ClientSecretFromHttpRequestBody = revokeTokenParameter.ClientSecret;
            return(result);
        }
示例#5
0
        private AuthenticateInstruction CreateAuthenticateInstruction(
            ClientCredentialsGrantTypeParameter clientCredentialsGrantTypeParameter,
            AuthenticationHeaderValue authenticationHeaderValue)
        {
            var result = _authenticateInstructionGenerator.GetAuthenticateInstruction(authenticationHeaderValue);

            result.ClientAssertion                 = clientCredentialsGrantTypeParameter.ClientAssertion;
            result.ClientAssertionType             = clientCredentialsGrantTypeParameter.ClientAssertionType;
            result.ClientIdFromHttpRequestBody     = clientCredentialsGrantTypeParameter.ClientId;
            result.ClientSecretFromHttpRequestBody = clientCredentialsGrantTypeParameter.ClientSecret;
            return(result);
        }