成功登录重定向后,Identityserver不返回用户

问题描述 投票:2回答:1

我在使用oidc-client.js在identityserver4中使用以下配置。它成功登录重定向。但是,即使在那之后,以下的“authUser”也总是为空。我做错了什么。我按照他们的示例应用程序

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();
    }

});
asp.net-core-mvc .net-core identityserver4 oidc oidc-client-js
1个回答
1
投票

其实。我没有调用以下功能。这是必需的。

signinRedirectCallback()
© www.soinside.com 2019 - 2024. All rights reserved.