尝试登录Okta时获取“OAUTH_ERROR”

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

我在我的本地服务器上设置了一个在http://localhost:4200上运行的角度应用程序。我使用Okta-signin-widget作为身份验证。提交登录表单时,我在控制台中收到以下错误:

error.errorCode: invalid_request, error.description: The 'redirect_uri' parameter 
must be an absolute URI that is whitelisted in the client app settings.

我用谷歌搜索,但我发现在Okta的开发者控制台中将http://localhost:4200添加到API>Trusted Origins,但这没有帮助(它已经定义)。

我在Okta应用程序设置中有以下内容:

Login redirect URIs:              http://localhost:4200/implicit/callback   
                                  http://localhost:4200/urlform

并在角度登录代码中定义了重定向URI,如下所示:

    this.widget.renderEl({
      el: '#okta-signin-container'},
      (res) => {
        if (res.status === 'SUCCESS') {
          this.signIn.loginRedirect('http://localhost:4200/urlform', { sessionToken: res.session.token });
          // Hide the widget
          this.widget.remove();
        }
      },
      (err) => {
        throw err;
      }
    );

但同样的问题。我不确定我是否在正确的页面上工作。

任何想法都非常感谢。

angular okta okta-signin-widget
1个回答
0
投票

http://localhost:4200添加到您的应用程序的登录重定向URI列表中,它应该可以解决问题。

© www.soinside.com 2019 - 2024. All rights reserved.