Which url is being used for the "Go to homepage" button?

Hey, when customizing the sign in widget there is a “Go to homepage” button if an error occurs. I was wondering which url this will bring you to and if it can be configured/changed?

I got to here by going to Settings → Customization → Custom Error Pages.

Not 100% but likely your default Okta org URL or the custom URL configured in Settings > Customization > Custom URL Domain. Not sure where you’d override this.

Great thanks @abole. Hopefully someone from Okta can jump on and confirm :+1:

The default behavior is to send the user to the end-user dashboard, so yes. Additionally, if you do have a Custom URL domain configured for your org, you can customize this button as part of the Custom Error Pages.

If you want to do so, you’re looking for this chunk of HTML:

                <h2 class="o-form-title">{{errorSummary}}</h2>
                <p class="o-form-explain">{{{errorDescription}}}</p>
                <a href="/" class="button">{{back}}</a>

If you want to redirect elsewhere, you can change the value for this href (making sure that the URL you want to redirect to is added to Trusted Origins for redirects) and change the message by replacing the {{back}} macro with whatever text you want on the button instead

1 Like

Thanks @andrea, helpful as always. I have multiple apps under my one single account so is it possible to specify a different “Go to homepage” url per app? Or would they all share the same url?

I don’t believe so, but its also not something I’ve tested before.

The first way I would think of doing this, using the requestContext is not possible, as you cannot get the application context on the error page like you can for the sign in page. But like I said, I haven’t necessarily attempted that level of customization.

1 Like

Yea I assume it can’t be done.

The reason I bring it up is because the Okta session will expire after 2 hours which automatically signs the user out but when I click “Next” to re-sign in I get a 400 bad request. From looking online it sounds like the issue occurs because the okta_key only has a 15 minute expiry, if the user does not attempt to re-sign in within this time after being automatically signed out, an error will occur. It sounds like this is currently working as designed as discussed here and there is an open enhancement to improve this. However, you can imagine how this will annoy some users when they click “Go to homepage” after being signed out of “App 2” and they are redirected to “App 1” because you can only have one “Go to homepage” url. Options could be to add refresh token rotation and extend the inactivity time from 2 hours to 2 days so that it’s not as annoying for users.

I wasn’t able to find an external feature in Okta Ideas requesting support for this, so you may want to file one to get it tracked.

Best I can think of doing right now is to sort of hack it together yourself, but I can only see that working in an SP initiated flow (e.g. you could track the application context on the sign in page, store it in in a cookie, and then see if it exists on the error page to provide the missing context), not if the user is launching it from their Okta dashboard.

So yeah, refresh tokens could help if this is occurring during re-authentication, but I can’t think of any other options

1 Like

Ah yea that’s fine thanks for all the replies. Having multiple apps under a single account this way may not be the norm anyway.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.