Beispiel #1
0
        private void InitializeFakeObjects()
        {
            _grantedTokenGeneratorHelperFake = new Mock <IGrantedTokenGeneratorHelper>();
            _scopeValidatorFake = new Mock <IScopeValidator>();
            _resourceOwnerAuthenticateHelperFake = new Mock <IResourceOwnerAuthenticateHelper>();
            _oauthEventSource       = new Mock <IOAuthEventSource>();
            _authenticateClientFake = new Mock <IAuthenticateClient>();
            _jwtGeneratorFake       = new Mock <IJwtGenerator>();
            _authenticateInstructionGeneratorStub = new Mock <IAuthenticateInstructionGenerator>();
            _clientRepositoryStub   = new Mock <IClientRepository>();
            _clientHelperStub       = new Mock <IClientHelper>();
            _grantedTokenHelperStub = new Mock <IGrantedTokenHelper>();
            _tokenStoreStub         = new Mock <ITokenStore>();

            _getTokenByResourceOwnerCredentialsGrantTypeAction = new GetTokenByResourceOwnerCredentialsGrantTypeAction(
                _grantedTokenGeneratorHelperFake.Object,
                _scopeValidatorFake.Object,
                _resourceOwnerAuthenticateHelperFake.Object,
                _oauthEventSource.Object,
                _authenticateClientFake.Object,
                _jwtGeneratorFake.Object,
                _authenticateInstructionGeneratorStub.Object,
                _clientRepositoryStub.Object,
                _clientHelperStub.Object,
                _tokenStoreStub.Object,
                _grantedTokenHelperStub.Object);
        }
Beispiel #2
0
 public TokenActions(
     IGetTokenByResourceOwnerCredentialsGrantTypeAction getTokenByResourceOwnerCredentialsGrantType,
     IGetTokenByAuthorizationCodeGrantTypeAction getTokenByAuthorizationCodeGrantTypeAction,
     IResourceOwnerGrantTypeParameterValidator resourceOwnerGrantTypeParameterValidator,
     IAuthorizationCodeGrantTypeParameterTokenEdpValidator authorizationCodeGrantTypeParameterTokenEdpValidator,
     IRefreshTokenGrantTypeParameterValidator refreshTokenGrantTypeParameterValidator,
     IGetTokenByRefreshTokenGrantTypeAction getTokenByRefreshTokenGrantTypeAction,
     IGetTokenByClientCredentialsGrantTypeAction getTokenByClientCredentialsGrantTypeAction,
     IClientCredentialsGrantTypeParameterValidator clientCredentialsGrantTypeParameterValidator,
     ISimpleIdentityServerEventSource simpleIdentityServerEventSource,
     IRevokeTokenAction revokeTokenAction,
     IEventPublisher eventPublisher,
     IPayloadSerializer payloadSerializer)
 {
     _getTokenByResourceOwnerCredentialsGrantType          = getTokenByResourceOwnerCredentialsGrantType;
     _getTokenByAuthorizationCodeGrantTypeAction           = getTokenByAuthorizationCodeGrantTypeAction;
     _resourceOwnerGrantTypeParameterValidator             = resourceOwnerGrantTypeParameterValidator;
     _authorizationCodeGrantTypeParameterTokenEdpValidator = authorizationCodeGrantTypeParameterTokenEdpValidator;
     _refreshTokenGrantTypeParameterValidator      = refreshTokenGrantTypeParameterValidator;
     _getTokenByRefreshTokenGrantTypeAction        = getTokenByRefreshTokenGrantTypeAction;
     _simpleIdentityServerEventSource              = simpleIdentityServerEventSource;
     _getTokenByClientCredentialsGrantTypeAction   = getTokenByClientCredentialsGrantTypeAction;
     _clientCredentialsGrantTypeParameterValidator = clientCredentialsGrantTypeParameterValidator;
     _revokeTokenAction = revokeTokenAction;
     _eventPublisher    = eventPublisher;
     _payloadSerializer = payloadSerializer;
 }
        private void InitializeFakeObjects()
        {
            _grantedTokenRepositoryFake      = new Mock <IGrantedTokenRepository>();
            _grantedTokenGeneratorHelperFake = new Mock <IGrantedTokenGeneratorHelper>();
            _scopeValidatorFake                  = new Mock <IScopeValidator>();
            _resourceOwnerValidatorFake          = new Mock <IAuthenticateResourceOwnerService>();
            _simpleIdentityServerEventSourceFake = new Mock <ISimpleIdentityServerEventSource>();
            _authenticateClientFake              = new Mock <IAuthenticateClient>();
            _jwtGeneratorFake = new Mock <IJwtGenerator>();
            _authenticateInstructionGeneratorStub = new Mock <IAuthenticateInstructionGenerator>();
            _clientRepositoryStub   = new Mock <IClientRepository>();
            _clientHelperStub       = new Mock <IClientHelper>();
            _grantedTokenHelperStub = new Mock <IGrantedTokenHelper>();

            _getTokenByResourceOwnerCredentialsGrantTypeAction = new GetTokenByResourceOwnerCredentialsGrantTypeAction(
                _grantedTokenRepositoryFake.Object,
                _grantedTokenGeneratorHelperFake.Object,
                _scopeValidatorFake.Object,
                _resourceOwnerValidatorFake.Object,
                _simpleIdentityServerEventSourceFake.Object,
                _authenticateClientFake.Object,
                _jwtGeneratorFake.Object,
                _authenticateInstructionGeneratorStub.Object,
                _clientRepositoryStub.Object,
                _clientHelperStub.Object,
                _grantedTokenHelperStub.Object);
        }