0
.net 1.1 핵심 코드에서 다음과 같이 인증을 수행하고 있습니다 (이는 베어러 토큰을 외부 URL로 보내고 리턴 토큰에서 클레임을 찾습니다). 이 코드는 Core 1.1에서 2.0으로 마이그레이션 - 인증
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationScheme = "Cookies"
});
app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
{
AuthenticationScheme = "oidc",
SignInScheme = "Cookies",
Authority = signinAuthority,
RequireHttpsMetadata = signinHTTPS,
ClientId = "skybus",
ClientSecret = "secret",
ResponseType = "code id_token",
Scope = { "api1", "offline_access" },
GetClaimsFromUserInfoEndpoint = true,
SaveTokens = true
});
이 지금은 모두
UseCookieAuthentication
&
UseOpenIdConnectAuthentication
이 변경을 코어 2.0 .NET으로 내 코드를 업그레이드
Configure
방법입니다. 나는 어려운 내가 위의 변경 후이 URL을 참조 브라우저에서
ConfigureServices
방법
services.AddAuthentication(options => {
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
})
.AddCookie()
.AddOpenIdConnect(o =>
{
o.Authority = signinAuthority;
o.SignInScheme = "Cookies";
o.RequireHttpsMetadata = signinHTTPS;
o.ClientId = "skybus";
o.ClientSecret = "secret";
o.ResponseType = "code id_token";
o.GetClaimsFromUserInfoEndpoint = true;
o.SaveTokens = true;
o.Scope.Add("api1");
o.Scope.Add("offline_access");
});
에서 다음대로로 변경 무엇이 경우
에서 수행해야 할 것을 찾기 위해 찾는거야. 사용자가 로그인 또는