javascript - Okta Sign In Widget redirect back to original page after login - Stack Overflow

I've been trying to find code examples that show how to redirect the user back to their original p

I've been trying to find code examples that show how to redirect the user back to their original page after logging in via the Okta Sign In widget.

If a user is sitting on a SAML enabled app and clicks login, they are redirected to the a page that has the Okta sign in widget. After a successful login, how do I send them back to the page where they clicked login?

I've been trying to find code examples that show how to redirect the user back to their original page after logging in via the Okta Sign In widget.

If a user is sitting on a SAML enabled app and clicks login, they are redirected to the a page that has the Okta sign in widget. After a successful login, how do I send them back to the page where they clicked login?

Share Improve this question asked Jul 27, 2017 at 17:11 Connie DeCinkoConnie DeCinko 1,0365 gold badges21 silver badges41 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

Directly from their website:

  <!-- Script to init the widget -->
  <script>
    var orgUrl = 'https://dev-144769.oktapreview.';
    var oktaSignIn = new OktaSignIn({baseUrl: orgUrl});

    oktaSignIn.renderEl(
      { el: '#okta-login-container' },
      function (res) {
        if (res.status === 'SUCCESS') { res.session.setCookieAndRedirect(orgUrl); }
      }
    );
  </script>

in this case the var 'orgUrl' defines the redirect URL for a successful login.

redefine orgUrl to be whatever the url you would like to provide is.

var orgUrl = "https://showme.this." //like this

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744796727a4594247.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信