public AuthenticationConfiguration(
     IOAuthAuthorizationServerProvider accessTokenProvider,
     IAuthenticationTokenProvider refreshTokenProvider)
 {
     _accessTokenProvider  = accessTokenProvider;
     _refreshTokenProvider = refreshTokenProvider;
 }
Exemplo n.º 2
0
 public SimpleOAuthAuthorizationServerOptions(
     IOAuthAuthorizationServerProvider oAuthAuthorizationServerProvider,
     IAuthenticationTokenProvider tokenProvider)
 {
     _provider      = oAuthAuthorizationServerProvider;
     _tokenProvider = tokenProvider;
 }
 internal static void Postfix(UserMessageHandler __instance,
                              MessageHandler.IMessageSender sender,
                              PacketEncryptionLayer encryptionLayer,
                              MasterServerEndPoint endPoint,
                              IAuthenticationTokenProvider authenticationTokenProvider)
 {
     GameClassInstanceProvider.Instance.UserMessageHandler = __instance;
 }
Exemplo n.º 4
0
 public ApiOAuthAuthorizationServerOptions(
     [Named("RefreshTokenProvider")]
     IAuthenticationTokenProvider refreshTokenProvider,
     [Named("AccessTokenProvider")]
     IAuthenticationTokenProvider accessTokenProvider,
     IOAuthAuthorizationServerProvider interalOAuthAuthorizationServerProvider)
 {
     _refreshTokenProvider = refreshTokenProvider;
     _accessTokenProvider  = accessTokenProvider;
     _interalOAuthAuthorizationServerProvider = interalOAuthAuthorizationServerProvider;
 }
Exemplo n.º 5
0
        public TdbrHttpClient(HttpClient httpClient, IAuthenticationTokenProvider authTokenProvider)
        {
            _httpClient             = httpClient;
            _httpClient.BaseAddress = new Uri("https://www.store-3d-blurayrental.com");
            _httpClient.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36");

            _cookieContainer = new CookieContainer();

            var token = authTokenProvider.GetToken();

            if (token != null)
            {
                _cookieContainer.SetCookies(_httpClient.BaseAddress, token.Replace(';', ','));
            }
        }
Exemplo n.º 6
0
        /// <summary>The configure authorization.</summary>
        /// <param name="simpleAuthServer">The simple auth server.</param>
        /// <param name="authTokenProvider">The auth token provider.</param>
        /// <param name="accessTokenFormat">The access token format.</param>
        /// <param name="accessTokenExpireTimeSpan">The access token expire time span.</param>
        /// <returns>The <see cref="OAuthAuthorizationServerOptions"/>.</returns>
        private static OAuthAuthorizationServerOptions ConfigureAuthorization(IOAuthAuthorizationServerProvider simpleAuthServer,
                                                                              IAuthenticationTokenProvider authTokenProvider,
                                                                              TicketDataFormat accessTokenFormat,
                                                                              int accessTokenExpireTimeSpan)
        {
            var oauthServerOptions = new OAuthAuthorizationServerOptions
            {
                AllowInsecureHttp         = true,
                TokenEndpointPath         = new PathString("/token"),
                AccessTokenExpireTimeSpan = TimeSpan.FromMinutes(accessTokenExpireTimeSpan),
                Provider             = simpleAuthServer,
                AccessTokenFormat    = accessTokenFormat,
                RefreshTokenProvider = authTokenProvider
            };

            return(oauthServerOptions);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Name: ConfigureOAuth
        /// Description: Metho to define the configuration of OAuth
        /// </summary>
        /// <param name="app">IAppBuilder</param>
        public void ConfigureOAuth(IAppBuilder app)
        {
            ProviderBuilder providerBuilder                      = ProviderBuilder.GetInstance();
            IOAuthAuthorizationServerProvider provider           = providerBuilder.GetProvider <IOAuthAuthorizationServerProvider>(ProviderBuilder.IAUTHAUTHORIZATIONSERVERPROVIDER);
            IAuthenticationTokenProvider      tokenProvider      = providerBuilder.GetProvider <IAuthenticationTokenProvider>(ProviderBuilder.IAUTHENTICATIONTOKENPROVIDER);
            OAuthAuthorizationServerOptions   OAuthServerOptions = new OAuthAuthorizationServerOptions()
            {
                AllowInsecureHttp         = true,
                TokenEndpointPath         = new PathString("/token"),
                AccessTokenExpireTimeSpan = TimeSpan.FromMinutes(120),
                Provider             = provider,
                RefreshTokenProvider = tokenProvider
            };

            app.UseOAuthAuthorizationServer(OAuthServerOptions);
            app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions());
        }
 public AuthenticationController(IUserProfileReader userProfileReader, IAuthenticationTokenProvider authenticationTokenProvider)
 {
     _userProfileReader           = userProfileReader;
     _authenticationTokenProvider = authenticationTokenProvider;
 }
 public IdentityProvider(IAuthenticationTokenProvider tokenProvider, IUserProvider userProvider)
 {
     _tokenProvider = tokenProvider;
     _userProvider  = userProvider;
 }