Ejemplo n.º 1
0
        public KonturPassportAuthenticationMiddleware(OwinMiddleware next, IAppBuilder app, KonturPassportAuthenticationOptions options)
            : base(next, options)
        {
            passportClient = new PassportClient(options.ClientId, new [] { "openid", "profile", "email" });

            if (Options.StateDataFormat == null)
            {
                var dataProtector = app.CreateDataProtector(
                    typeof(KonturPassportAuthenticationMiddleware).FullName,
                    Options.AuthenticationType,
                    "v1");
                Options.StateDataFormat = new PropertiesDataFormat(dataProtector);
            }
        }
        public KonturPassportAuthenticationMiddleware(OwinMiddleware next, IAppBuilder app, KonturPassportAuthenticationOptions options)
            : base(next, options)
        {
            log = LogManager.GetLogger(typeof(KonturPassportAuthenticationMiddleware));
            var clientConfiguration = new PassportClientConfiguration
            {
                ClientId     = Options.ClientId,
                ClientSecret = Options.ClientSecret,
                Scope        = "profile email",
            };
            var clientOptions = new ClientOptions(clientConfiguration);

            passportClient = new PassportClient(clientOptions);

            if (Options.StateDataFormat == null)
            {
                var dataProtector = app.CreateDataProtector(
                    typeof(KonturPassportAuthenticationMiddleware).FullName,
                    Options.AuthenticationType,
                    "v1");
                Options.StateDataFormat = new PropertiesDataFormat(dataProtector);
            }
        }
Ejemplo n.º 3
0
 public KonturPassportAuthenticationHandler(PassportClient passportClient, ILog log)
 {
     this.passportClient = passportClient;
     this.log            = log;
 }
Ejemplo n.º 4
0
 public KonturPassportAuthenticationHandler(PassportClient passportClient)
 {
     this.passportClient = passportClient;
 }