<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D50Z00008G7VH2SANOkta Classic EngineIntegrationsAnswered2018-09-05T01:29:08.000Z2017-06-15T18:17:32.000Z2017-06-15T18:17:32.000Z
OktaSignIn doesn't work perfectly
I have encountered a problem when I tried OktaSignIn for authentication and the basic code is shown below. When I access login.php, the auth page is shown up to ask valid user/password. If I don't input anything but just refresh this page, OktaSignIn automatically rendered to success(res) function which by passed the real authenticating and is a big hole. I am not sure if I used it in a wrong way, or a preblem of the OktaSignIn. anyone can help on it? Thanks 

 

login.php

<!DOCTYPE html>

<link type="text/css" rel="stylesheet" href="https://ok1static.oktacdn.com/assets/js/sdk/okta-signin-widget/1.11.0/css/okta-theme.css" />

<link type="text/css" rel="stylesheet" href="https://ok1static.oktacdn.com/assets/js/sdk/okta-signin-widget/1.11.0/css/okta-sign-in.min.css" />

<script type="text/javascript" src="https://ok1static.oktacdn.com/assets/js/sdk/okta-signin-widget/1.11.0/js/okta-sign-in.min.js"></script>

 

<div id="okta-login"></div>

<script>

    var signIn = new OktaSignIn(/*config*/);

    signIn.renderEl(

        {el: '#okta-login'},

        function success(res) {

            if (res.status === 'SUCCESS') {

               window.location.reload();

            }

        }

    );

</script>

  • Hi Liang Sun,

     

    Thanks for your post on the community. I am trying to understand what you are writing here. Since the widget is using javascript, all code is rendered on the client (including the success flow). Once the user is succesfully authenticated - and only then - a cookie will be set for the established Okta session. There are also flows for checking if the user already has a session etc.

     

    More information is available here: https://developer.okta.com/code/javascript/okta_sign-in_widget_ref

     

    Expand Post
This question is closed.
Loading
OktaSignIn doesn't work perfectly