AspNet Core如何在控制器中更改MicrosoftAccountOptions / GoogleOptions / FacebookOptions / TwitterOptions

时间:2017-12-19 08:32:39

标签: asp.net-core

这是在Startup.cs ConfigureServices我如何配置OAuth提供程序

services.AddAuthentication(options => {
                options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
            })
            .AddFacebook(x => {
                x.AppId = "xxx";
                x.AppSecret = "xxx";
            })
            .AddTwitter(x => {
                x.ConsumerKey = "xxx";
                x.ConsumerSecret = "xxx";
            })
            .AddGoogle(x => {
                x.ClientId = "xxx";
                x.ClientSecret = "xxx";
            })
            .AddMicrosoftAccount(x => {
                x.ClientId = "xxx";
                x.ClientSecret = "xxx";
            })

然后,对于某些要求,我需要在控制器操作中更新AppId / AppSecret,我该怎么做?

0 个答案:

没有答案