Exemplo n.º 1
0
        public static void UseQQConnectAuthentication(this IAppBuilder app, QQConnectAuthenticationOptions options)
        {
            if (app == null)
            {
                throw new ArgumentNullException("app");
            }
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            app.Use(typeof(QQConnectAuthenticationMiddleware), app, options);
        }
        public static void ConfigureIdentityProviders(IAppBuilder app, string signInAsType)
        {
            var msOptions = new MicrosoftAccountAuthenticationOptions
            {
                AuthenticationType         = "Microsoft",
                SignInAsAuthenticationType = signInAsType,
                ClientId     = "myClientId",
                ClientSecret = "mySecret"
            };

            app.UseMicrosoftAccountAuthentication(msOptions);

            var qqOptions = new QQConnectAuthenticationOptions
            {
                AuthenticationType         = "QQ",
                SignInAsAuthenticationType = signInAsType,
                AppId     = "myClientId",
                AppSecret = "mySecret"
            };

            app.UseQQConnectAuthentication(qqOptions);
        }