Hello All,

I have been attempting to try and integrate okta login to a application. I’ll throw a link to the app bellow but it is a very simple vanilla JS, HTML and CSS application.

My main question is can I use okta to initially direct users to a login page (index.html) and then redirect them to the main application page after a successful login(main.html)? I have added to my Login redirect URIs via my Okta dashboard and my code at index.html looks like this;

    const oktaSignIn = new OktaSignIn({

    baseUrl: "",

    **redirect_uri: "",**

    clientId: "0oabhudxi6ZwiOiOu5d6",

    authParams: {

      issuer: "",

      responseType: ['token', 'id_token'],

      display: 'page',



  if (oktaSignIn.token.hasTokensInUrl()) {


      // If we get here, the user just logged in.

      function success(res) {

        var accessToken = res[0];

        var idToken = res[1];

        oktaSignIn.tokenManager.add('accessToken', accessToken);

        oktaSignIn.tokenManager.add('idToken', idToken);


        document.getElementById("messageBox").innerHTML = "Hello, " + + "! You just logged in!";


      function error(err) {




  } else {

    oktaSignIn.session.get(function (res) {

      // If we get here, the user is already signed in.

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

        document.getElementById("messageBox").innerHTML = "Hello, " + res.login + "! You are logged in!";




        { el: '#okta-login-container' },

        function success(res) {},

        function error(err) {







the link to my GitHub repo is:

If it is not possible to do this with pages or I’m doing something wrong I would greatly appreciate any insight.

Thank you all in advance!


Yes, you should be able to do this. Where are you being redirected currently? Or are you seeing an error?