Social identity provider redirection

Hi,

I have an issue when I try to login with Google or Facebook (ok with username/password).
When I login, i’m redirected to /app/UserHome (okta website).

I use okta-signin-widget in my angular app.

this.widget = new OktaSignIn({
  baseUrl: 'https://xxx.okta.com',
  idps: [
    {type: 'Facebook', id: 'xxx'},
    {type: 'Google', id: 'xxx'}
  ],
  authParams: {
    pkce: true
  },
  idpDisplay: 'PRIMARY',
  registration: {
    parseSchema: function(schema, onSuccess, onFailure) {
       // handle parseSchema callback
       onSuccess(schema);
    },
    preSubmit: function (postData, onSuccess, onFailure) {
       // handle preSubmit callback
       console.log(postData);
       onSuccess(postData);
    },
    postSubmit: function (response, onSuccess, onFailure) {
        // handle postsubmit callback
        console.log(response);
       onSuccess(response);
    }
  },
  features: {
     registration: true
  }
});

this.widget.renderEl({
      el: '#okta-signin-container'},
      (res) => {
        if (res.status === 'SUCCESS') {
          console.log(res);
          res.session.setCookieAndRedirect('https://localhost:4200/login');
          // Hide the widget
          this.widget.hide();
        }
      },
      (err) => {
        throw err;
      }
    );

What did i forget to do?

Best regards

2 Likes

@max9000 did you find the issue? I’m having the same problem :frowning:

@al2 and @max9000 Take a look at the following KB article to see if this solution works for you: Social Auth redirect not working with Okta Sign-in Widget