# GitHub.io compatibility

**URL:** <https://devforum.okta.com/t/github-io-compatibility/13330>\
**Category:** Questions\
**Created:** [March 13, 2021, 8:14pm UTC](https://devforum.okta.com/t/github-io-compatibility/13330 "2021-03-13T20:14:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrR0b0t](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@MrR0b0t](https://devforum.okta.com/u/MrR0b0t)\
**Post date:** [March 13, 2021, 8:14pm UTC](https://devforum.okta.com/t/github-io-compatibility/13330/1 "2021-03-13T20:14:48Z")

</div>

Hello All,

I have been attempting to try and integrate okta login to a [GitHub.io](http://GitHub.io) 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 https://web-dev-jr.github.io/JS-Pomodor/main to my Login redirect URIs via my Okta dashboard and my code at index.html looks like this;

```
    const oktaSignIn = new OktaSignIn({

    baseUrl: "https://dev-70746537.okta.com",

    **redirect_uri: "https://web-dev-jr.github.io/JS-Pomodor/main",**

    clientId: "0oabhudxi6ZwiOiOu5d6",

    authParams: {

      issuer: "https://dev-70746537.okta.com/oauth2/default",

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

      display: 'page',

    }

  });

  if (oktaSignIn.token.hasTokensInUrl()) {

    oktaSignIn.token.parseTokensFromUrl(

      // 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);

        window.location.hash='';

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

      },

      function error(err) {

        console.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!";

        return;

      }

      oktaSignIn.renderEl(

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

        function success(res) {},

        function error(err) {

          console.error(err);

        }

      );

    });

  }

    </script>

```

the link to my GitHub repo is: [https://github.com/Web-Dev-Jr/JS-Pomodor/tree/main](https://github.com/Web-Dev-Jr/JS-Pomodor/tree/main)

If it is not possible to do this with [GitHub.io](http://GitHub.io) pages or I’m doing something wrong I would greatly appreciate any insight.

Thank you all in advance!

Sam

---

<div class="post-metadata">

**Author:** ![erin.p](https://avatars.discourse-cdn.com/v4/letter/e/e480ec/32.png) [@erin.p](https://devforum.okta.com/u/erin.p)\
**Post date:** [March 15, 2021, 3:21pm UTC](https://devforum.okta.com/t/github-io-compatibility/13330/2 "2021-03-15T15:21:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 6, 2024, 11:18pm UTC](https://devforum.okta.com/t/github-io-compatibility/13330/3 "2024-02-06T23:18:01Z")

</div>

Closed on February 6, 2024, 11:18pm UTC


