Beispiel #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);
            }
        }
Beispiel #3
0
 public KonturPassportAuthenticationHandler(PassportClient passportClient, ILog log)
 {
     this.passportClient = passportClient;
     this.log            = log;
 }
Beispiel #4
0
 public KonturPassportAuthenticationHandler(PassportClient passportClient)
 {
     this.passportClient = passportClient;
 }