Widget to redirect to Okta Dashboard (no OIDC flow)

Checking documentation, which says that to redirect to Okta Dashboard …


you pass a second param to signIn.renderEl(...)
function success(res) {
  if (res.status === 'SUCCESS') {
    res.session.setCookieAndRedirect('https://${yourOktaDomain}/app/UserHome');
  }
}

the problem is that res.session is undefined. But if I try to use signIn.authClient.session.setCookieAndRedirect(sessionToken, redirectUri) the question is where do I get sessionToken from? That’s a bit confusing…

And you definitely don’t have any config settings related to OIDC being set? I’m not having an issue getting this to work, and get my cookie set with the following:

<!DOCTYPE html>
<html>
    <head>
        <script src="https://global.oktacdn.com/okta-signin-widget/5.2.0/js/okta-sign-in.min.js" type="text/javascript"></script>
        <link href="https://global.oktacdn.com/okta-signin-widget/5.2.0/css/okta-sign-in.min.css" type="text/css" rel="stylesheet"/>
    </head>
    <body>
        <div id="widget"></div>
        <script>
            var config = { baseUrl: oktaDomain }
            var signIn = new OktaSignIn(config)

            signIn.renderEl({
                el: "#widget"
            },
            function success (res){
                if (res.status === 'SUCCESS'){
                    res.session.setCookieAndRedirect("http://localhost:8080")
                }
            })
        </script>
    </body>
</html>

I just wanted to note this here that @phi1ipp was running into this issue with a certain feature enabled in their org. We’re looking to investigate this internally.