사용자가 내 API에 액세스 할 수 있도록 인증 및 권한 부여를 구현하기 위해 Identity Server 4를 사용하고 있습니다.Identity Server : 액세스 토큰과 함께 비밀번호 재설정 링크 보내기
ClientName = "angular2client",
ClientId = "angular2client",
AccessTokenType = AccessTokenType.Jwt,
AllowedGrantTypes = GrantTypes.Implicit,
AllowAccessTokensViaBrowser = true,
RedirectUris = new List<string>
{
"http://localhost:5000" //we have to provide https for all the urls
},
PostLogoutRedirectUris = new List<string>
{
"http://localhost:5000/Unauthorized"
},
AllowedCorsOrigins = new List<string>
{
"http://localhost:5000",
},
AllowedScopes = new List<string>
{
"openid",
"resourceAPIs"
}
내가 그들을 전송하여 사용자 비밀번호 재설정 옵션을 제공 할 계획입니다 자신의 이메일에 링크 : 그것은 angular2 클라이언트 응용 프로그램을 인증하는 암시 적 흐름과 OIDC를 사용합니다. 전통적인 구현에서 사용자 정의 해시, 사용자 ID 및 만료 기간을 사용하여 내 DB에 항목을 추가 한 다음 해당 링크를 사용자에게 보냅니다. 그가 암호 재설정 링크를 요청하면 db에 대해 유효성을 검사하고 해당 항목이 아직 유효한지 확인합니다.
현재 내 솔루션은 Identity Server, Resource Server (API) 및 Angle 2 애플리케이션의 두 가지 서버로 구성됩니다. 사용자는 응용 프로그램에 액세스하기 위해 토큰을 가져와야 만 API에 액세스 할 수있는 권한이 부여됩니다. 토큰이 유효하지 않은 경우 API를 호출 할 수 없습니다. 내가하고 싶은 경우
app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
{
Authority = "http://localhost:44311",
ScopeName = "resourceAPIs",
RequireHttpsMetadata = false
});
해당 ID 서버 4를 사용하고, 그 암호 변경 API에 액세스 할 수있는 토큰을 이메일 링크를 보내 : 이 자원 서버가 토큰의 유효성을 검사하는 방법이다. 고객에게 어떤 변화를 주어야합니까?
리소스 API에 액세스 할 때 동일한 토큰을 사용하지 못하게하려면이 단일 "비밀번호 재설정 API"에 대한 액세스 권한이있는 다른 클라이언트를 추가해야합니까? 이러한 구현의 모범 사례는 무엇입니까?