代码之家  ›  专栏  ›  技术社区  ›  Paritosh

未定义Oidc客户端用户管理器错误

  •  0
  • Paritosh  · 技术社区  · 6 年前

    https://www.scottbrady91.com/OpenID-Connect/Silent-Refresh-Refreshing-Access-Tokens-when-using-the-Implicit-Flow (他使用身份4)

    <head>
        <title></title>
    </head>
    <body>
            <script src="https://cdnjs.cloudflare.com/ajax/libs/oidc-client/1.3.0/oidc-client.js"></script>
    <script>    
        new UserManager().signinSilentCallback()
            .catch((err) => {
                console.log(err);
            });
    </script>
    </body>
    

    最初,我直接引用odic-client.js文件作为他的示例,但无论哪种方式,我都会得到以下错误:

    VM861 silent refresh.html:7未捕获引用错误:未定义用户管理器 在VM861静默刷新。html:7

    1 回复  |  直到 6 年前
        1
  •  0
  •   Paritosh    6 年前

    我成功了,我必须做两件事:

    1. 在Identity Server客户端中,我必须设置 RequireConsent = false ,这是有道理的,因为我正在做一个无声的刷新我不能要求常量。

    2. window.location.hash = decodeURIComponent(window.location.hash);

    在那之后我看到令牌刷新。