0

I have set up an angular app running on http://localhost:4200 on my local server. I am using Okta-signin-widget as authentication. When submitting the login form I get the following error in console:

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

I googled but what I found was adding http://localhost:4200 to the API>Trusted Origins in the Okta's Developer Console, but that did not help (it was already defined).

I have the following in my Okta applicaiton setting:

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

and defined the redirect URI in the angular login code like this:

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

But same problem. I am not sure if I am working on the right page.

Any ideas is highly appreciated.

4

1 回答 1

0

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

于 2019-04-27T22:08:59.593 回答