IdentityServer3에서 작동하는 토큰 URL에 액세스하려고합니다.IdentityServer3, 암시 적 플로우, 토큰을 얻는 방법?
이var options = new IdentityServerOptions
{
LoggingOptions = new LoggingOptions
{
WebApiDiagnosticsIsVerbose = true,
EnableWebApiDiagnostics = true,
EnableHttpLogging = true,
EnableKatanaLogging= true
},
Factory = new IdentityServerServiceFactory()
.UseInMemoryClients(Clients.Get())
.UseInMemoryScopes(Scopes.Get())
.UseInMemoryUsers(Users.Get()),
RequireSsl = false,
EnableWelcomePage = false,
};
app.UseIdentityServer(options);
는 클라이언트 구성 :
new Client
{
Enabled = true,
ClientName = "JS Client",
ClientId = "js",
Flow = Flows.Implicit,
RedirectUris = new List<string>
{
"http://localhost:56522"
},
AllowedCorsOrigins = new List<string>
{
"http://localhost:56522"
},
AllowAccessToAllScopes = true
}
엔드 포인트 토큰 다음 HTTP 요청을 POST 시도 : 서버는 다음과 같은 방법으로 구성되어
Content-Type:application/x-www-form-urlencoded
grant_type:password
redirect_uri:http://localhost:56522
client_id:js
username:bob
password:secret
scope:api
내가 잘못된 클라이언트를 얻기를 오류 메시지 및 로그 표시 : 조치가 'IdentityServer3.Core.Results.Tok enErrorResult '', Operation = ReflectedHttpActionDescriptor.ExecuteAsync
어떤 아이디어가 여전히 누락 되었습니까?
IdentityServer에 대한 GET 요청을 생성하고 토큰을 얻으려고 시도 할 수 있습니다.이 요청을 시도해보십시오 : '/ connect/authorize? client_id = js & redirect_uri = http : // localhost : 56522 & response_type = token & scope = api & state = ef969376c1d34ccaa03f8cd449c96bd7' 보호를위한 가치 - 클라이언트에서 비교) js 클라이언트의 경우이 라이브러리를 사용할 수 있습니다 (https://github.com/IdentityModel/oidc-client-js). – Jenan