尝试登录Okta时收到“ OAUTH_ERROR”

时间:2019-04-27 11:35:59

标签: angular okta okta-signin-widget

我已经在本地服务器上的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.

我用Google搜索,但发现是在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;
      }
    );

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

任何想法都受到高度赞赏。

1 个答案:

答案 0 :(得分:0)

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

相关问题