0
damienbod Ang2 Id Serv 4 OIDC에서 제공하는 예제 (아이덴티티 서버 (수정 된 구현), Resource API 및 ng-2 응용 프로그램)가있는 다음 예제를 따르고 있습니다.Identity Server : 토큰 유형 jwt vs OIDC를 사용한 암시 적 플로우 인증을 사용하는 참조
신원 확인 서버에서 인증을 받고 내 보호 된 API에 액세스하려고하면 오류 401 (인증되지 않음)이 표시됩니다.
참조 서버 대신 참조 대신 jwt의 토큰 유형을 사용하도록 클라이언트를 변경 한 다음 올바르게 작동했습니다. 신원 서버
클라이언트 구성 :
ClientName = "angular2client",
ClientId = "angular2client",
AccessTokenType = AccessTokenType.Jwt,
AllowedGrantTypes = GrantTypes.Implicit,
AllowAccessTokensViaBrowser = true,
//redirect urls are ommited
AllowedScopes = new List<string>
{
"openid",
"resourceAPIs",
"role",
}
자원 API 다음 JWT 토큰 유형을 만든 이유는 신원 확인이
내가 알 필요가app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
{
Authority = "http://localhost:44311",
ScopeName = "resourceAPIs",
RequireHttpsMetadata = false
});
, 그것은 작동하고 어떤 코드 참조 유형 토큰이 작동하도록 수정하려면?