Stay logged in to Okta SSO

Stay logged in to Okta SSO

If you have any Single Sin On system you have to use on a regular basis then the chances are that you find having to log in over and over again to access your normal sites in extremely tedious. 

Having experienced this in the past I decided to make a Tampermonkey script to save me the hassle. 

Tampermonkey is extremely easy and user friendly to use, it is a chrome extension that allows you to execute JavaScript on any web page you like as if it were embedded in the page it's self. 

First of all install the Tampermonkey Chrome Plugin

Now you have tampermonkey just open the user interface and add this script, remember to change the URL of the page you want to target and add your email and password. 

Once you have done this just open the SSO page and pin that tab in Chrome so it is always open in your browser and the script will do the rest. 

// ==UserScript==
// @name       Okta stay logged in.
// @namespace
// @version    0.1
// @description  Keeps you logged in to your Okta SSO console
// @match*
// @copyright  2012+, You
// ==/UserScript==
var ssologin = function () {
    var email = document.getElementById('user-signin');
    if (email) {
        var pass = document.getElementById('pass-signin');
        var signin_button = document.getElementById('signin-button');
        email.value = '';
        pass.value = 'PASSWORD';
        var evt = document.createEvent("HTMLEvents");
        evt.initEvent('click', true, true);
        console.log('Logged In');
    var button = document.getElementById('session-timeout-ok');
    if (button) {
        var evt = document.createEvent("HTMLEvents");
        evt.initEvent('click', true, true);
window.setInterval(ssologin, 10000);


Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.