Asp.net core mvc Identityserver在成功登录重定向后未返回用户
我使用oidc-client.js在identityserver4中使用以下配置。它成功地标识了重定向。但是下面的“authUser”总是为空,即使之后也是如此。我怎么了。我遵循了他们的申请样本Asp.net core mvc Identityserver在成功登录重定向后未返回用户,asp.net-core-mvc,.net-core,identityserver4,openid-connect,oidc-client-js,Asp.net Core Mvc,.net Core,Identityserver4,Openid Connect,Oidc Client Js,我使用oidc-client.js在identityserver4中使用以下配置。它成功地标识了重定向。但是下面的“authUser”总是为空,即使之后也是如此。我怎么了。我遵循了他们的申请样本 const config = { authority: "http://localhost:5000", client_id: "js", redirect_uri: "http://localhost:5003", response_type: "id_token to
const config = {
authority: "http://localhost:5000",
client_id: "js",
redirect_uri: "http://localhost:5003",
response_type: "id_token token",
scope: "openid profile api1",
post_logout_redirect_uri: "http://localhost:5003",
};
const mgr = new Oidc.UserManager(config);
mgr.getUser().then(function (authUser) {
if (authUser) {
//Home Page Coding will go here.
}
else {
mgr.signinRedirect();
}
});
事实上。我没有调用下面的函数。这是必须的
signinRedirectCallback()
请检查您的重定向uri,这是客户端从服务器获取令牌和其他信息以进行处理的地方