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 badges1 Answer
Reset to default 8Directly 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条)