# \#javascript

**URL:** https://devforum.okta.com/tag/javascript/40.md

[Latest](https://devforum.okta.com/latest.md) · [Categories](https://devforum.okta.com/categories.md) · [Tags](https://devforum.okta.com/tags.md)

---

## [Is there a way to require outside files in the code editor javascript?](https://devforum.okta.com/t/is-there-a-way-to-require-outside-files-in-the-code-editor-javascript/29779)

<div class="topic-metadata">

**Author:** [@kmattox](https://devforum.okta.com/u/kmattox)\
**Replies:** 1\
**Last updated:** [August 26, 2024, 7:05pm UTC](https://devforum.okta.com/t/is-there-a-way-to-require-outside-files-in-the-code-editor-javascript/29779 "2024-08-26T19:05:25Z")

</div>

Is there a way to require outside files in the code editor javascript? Our sign-in page is getting quite large. We could use require statements but where/how would we place such a file?

---

## [Can an Okta profile be accessed from the sign in page javascript?](https://devforum.okta.com/t/can-an-okta-profile-be-accessed-from-the-sign-in-page-javascript/29780)

<div class="topic-metadata">

**Author:** [@kmattox](https://devforum.okta.com/u/kmattox)\
**Replies:** 2\
**Last updated:** [August 6, 2024, 6:33pm UTC](https://devforum.okta.com/t/can-an-okta-profile-be-accessed-from-the-sign-in-page-javascript/29780 "2024-08-06T18:33:34Z")

</div>

Can an Okta profile and it’s properties be accessed from the sign in page javascript? We have the user’s profile name already.

---

## [Okta Sign-in Widget: run a hook after the Okta session is created](https://devforum.okta.com/t/okta-sign-in-widget-run-a-hook-after-the-okta-session-is-created/29209)

<div class="topic-metadata">

**Author:** [@python](https://devforum.okta.com/u/python)\
**Replies:** 1\
**Last updated:** [July 18, 2024, 10:07am UTC](https://devforum.okta.com/t/okta-sign-in-widget-run-a-hook-after-the-okta-session-is-created/29209 "2024-07-18T10:07:17Z")

</div>

My use-case is that I want to forward the Okta user ID to user analytics once the user has signed in, and manage this from the Okta side, to avoid needing to implement the same functionality across all SSO apps. The user…

---

## [Webapp no longer recognizing cookies/Can't login](https://devforum.okta.com/t/webapp-no-longer-recognizing-cookies-cant-login/29378)

<div class="topic-metadata">

**Author:** [@m88](https://devforum.okta.com/u/m88)\
**Replies:** 2\
**Last updated:** [July 16, 2024, 2:32pm UTC](https://devforum.okta.com/t/webapp-no-longer-recognizing-cookies-cant-login/29378 "2024-07-16T14:32:32Z")

</div>

Hi. I’ve been using the Sign-In Widget for the past 5+ years without issue. Recently, my office upgraded the browser we use internally, and my webapp is no longer recognizing credentials or cookies. If I sign in using th…

---

## [Okta token validation](https://devforum.okta.com/t/okta-token-validation/28951)

<div class="topic-metadata">

**Author:** [@jude.b](https://devforum.okta.com/u/jude.b)\
**Replies:** 2\
**Last updated:** [June 25, 2024, 7:53pm UTC](https://devforum.okta.com/t/okta-token-validation/28951 "2024-06-25T19:53:53Z")

</div>

Is it possible to validate the okta token using okta-auth-js on server-side?

---

## [Is there any way to show okta login page always if multiple user wants to login from single browser?](https://devforum.okta.com/t/is-there-any-way-to-show-okta-login-page-always-if-multiple-user-wants-to-login-from-single-browser/28141)

<div class="topic-metadata">

**Author:** [@Jas1](https://devforum.okta.com/u/Jas1)\
**Replies:** 2\
**Last updated:** [May 14, 2024, 7:18am UTC](https://devforum.okta.com/t/is-there-any-way-to-show-okta-login-page-always-if-multiple-user-wants-to-login-from-single-browser/28141 "2024-05-14T07:18:49Z")

</div>

We have a case in which if user logs out, we are clearing the storage using the method provided by okta-auth-js i.e: “oktaAuth.tokenManager.clear()”. Using this method user gets logout from the Application but OKTA sessi…

---

## [Customize Okta Sign in Widget with MFA dropdowns](https://devforum.okta.com/t/customize-okta-sign-in-widget-with-mfa-dropdowns/27754)

<div class="topic-metadata">

**Author:** [@pmd](https://devforum.okta.com/u/pmd)\
**Replies:** 1\
**Last updated:** [April 22, 2024, 7:01pm UTC](https://devforum.okta.com/t/customize-okta-sign-in-widget-with-mfa-dropdowns/27754 "2024-04-22T19:01:00Z")

</div>

I’ve painstakingly overridden the CSS for the Okta Sign In Widget to work well with our application on a 4K monitor and to make it look like our brand. I still need to do the dropdowns for MFA selections but it is provi…

---

## [How to extend the Okta session](https://devforum.okta.com/t/how-to-extend-the-okta-session/26841)

<div class="topic-metadata">

**Author:** [@David.Klempfner](https://devforum.okta.com/u/David.Klempfner)\
**Replies:** 0\
**Last updated:** [February 16, 2024, 1:45am UTC](https://devforum.okta.com/t/how-to-extend-the-okta-session/26841 "2024-02-16T01:45:25Z")

</div>

Hi, I have a few questions: According to https://support.okta.com/help/s/article/Why-is-the-GET-Current-Session-API-call-extending-the-users-session: “This action retrieves the user’s session cookie and extends the se…

---

## [Okta-auth-js SDK: Clearing the Okta storageManager best practices?](https://devforum.okta.com/t/okta-auth-js-sdk-clearing-the-okta-storagemanager-best-practices/26351)

<div class="topic-metadata">

**Author:** [@mmd](https://devforum.okta.com/u/mmd)\
**Replies:** 1\
**Last updated:** [January 25, 2024, 6:22am UTC](https://devforum.okta.com/t/okta-auth-js-sdk-clearing-the-okta-storagemanager-best-practices/26351 "2024-01-25T06:22:40Z")

</div>

Hi, our team has an app that uses the okta-auth-js sdk to login a user. We’re wondering what cleanup procedures we should follow ahead of starting a new login. For example, if two users share a computer and their Okta se…

---

## [Using redirect method on vanilla javascript app](https://devforum.okta.com/t/using-redirect-method-on-vanilla-javascript-app/26384)

<div class="topic-metadata">

**Author:** [@Ogoley](https://devforum.okta.com/u/Ogoley)\
**Replies:** 1\
**Last updated:** [January 17, 2024, 4:10pm UTC](https://devforum.okta.com/t/using-redirect-method-on-vanilla-javascript-app/26384 "2024-01-17T16:10:37Z")

</div>

Hello I am using the method shown in this article Sign users in to your SPA using the redirect model | Okta Developer. The problem is that I am seeing my webpage flash before being redirected to the okta sign in. Is this…

---

## [isAuthenticated() function of oktaClient is always returning 'false'](https://devforum.okta.com/t/isauthenticated-function-of-oktaclient-is-always-returning-false/25120)

<div class="topic-metadata">

**Author:** [@Bhargav](https://devforum.okta.com/u/Bhargav)\
**Replies:** 5\
**Last updated:** [September 6, 2023, 7:22am UTC](https://devforum.okta.com/t/isauthenticated-function-of-oktaclient-is-always-returning-false/25120 "2023-09-06T07:22:24Z")

</div>

Even after successful login isAuthenticated() is returning false which is causing problem while I’m checking condition for logout. Is there anyway to cure this issue of isAuthenticated I also checked the similar issues …

---

## [Utilising refresh tokens with the javascript sdk](https://devforum.okta.com/t/utilising-refresh-tokens-with-the-javascript-sdk/24459)

<div class="topic-metadata">

**Author:** [@Armanto](https://devforum.okta.com/u/Armanto)\
**Replies:** 1\
**Last updated:** [June 7, 2023, 7:48am UTC](https://devforum.okta.com/t/utilising-refresh-tokens-with-the-javascript-sdk/24459 "2023-06-07T07:48:19Z")

</div>

Hey all. It’s the first time I am working with both okta & refresh tokens. At the moment I am trying to implement a solution using refresh token for a client side application and I am using the okta javascript sdk. I fou…

---

## [Okta Android SDK function to open a web app in webview](https://devforum.okta.com/t/okta-android-sdk-function-to-open-a-web-app-in-webview/22283)

<div class="topic-metadata">

**Author:** [@Megha](https://devforum.okta.com/u/Megha)\
**Replies:** 1\
**Last updated:** [April 5, 2023, 5:58am UTC](https://devforum.okta.com/t/okta-android-sdk-function-to-open-a-web-app-in-webview/22283 "2023-04-05T05:58:23Z")

</div>

Hi everyone I have to perform SSO from one mobile app to a web app using a token exchange mechanism. According to Okta Configuration, both applications are “Native apps.” With the help of the android-sdk github document…

---

## [Okta auth-js authStateManager not being updated on clear user session](https://devforum.okta.com/t/okta-auth-js-authstatemanager-not-being-updated-on-clear-user-session/21539)

<div class="topic-metadata">

**Author:** [@fcerullo](https://devforum.okta.com/u/fcerullo)\
**Replies:** 2\
**Last updated:** [March 10, 2023, 12:40pm UTC](https://devforum.okta.com/t/okta-auth-js-authstatemanager-not-being-updated-on-clear-user-session/21539 "2023-03-10T12:40:57Z")

</div>

Hi All involved libary is "@okta/okta-angular": "^5.2.0", "@okta/okta-auth-js": "6.7.4", "@okta/okta-signin-widget": "6.6.1" If I clear the session from Okta Admin Console or by API call, the subscription to the authS…

---

## [Trying to implement okta-oauth-js examples, no permission to fetch openid-configuration](https://devforum.okta.com/t/trying-to-implement-okta-oauth-js-examples-no-permission-to-fetch-openid-configuration/23527)

<div class="topic-metadata">

**Author:** [@jrg](https://devforum.okta.com/u/jrg)\
**Replies:** 3\
**Last updated:** [March 4, 2023, 5:49pm UTC](https://devforum.okta.com/t/trying-to-implement-okta-oauth-js-examples-no-permission-to-fetch-openid-configuration/23527 "2023-03-04T17:49:36Z")

</div>

I have an Okta developer account set up with the ‘default’ authorization server that it came with, and configured for an SPA requiring PKCE and a grant type of Authorization Code. I’ve manually worked through the author…

---

## [Specify redirectURI in getWithRedirect() Okta-auth-js library](https://devforum.okta.com/t/specify-redirecturi-in-getwithredirect-okta-auth-js-library/23313)

<div class="topic-metadata">

**Author:** [@sseekamp](https://devforum.okta.com/u/sseekamp)\
**Replies:** 3\
**Last updated:** [February 27, 2023, 10:11pm UTC](https://devforum.okta.com/t/specify-redirecturi-in-getwithredirect-okta-auth-js-library/23313 "2023-02-27T22:11:47Z")

</div>

What I want to accomplish: A user signs into my app and lands on an authenticated page. I need to call various vendor specific authorization servers and apps (web app with client secret) from the UI to retrieve an auth…

---

## [Sharing authentication with another domain](https://devforum.okta.com/t/sharing-authentication-with-another-domain/22476)

<div class="topic-metadata">

**Author:** [@grayson.langford](https://devforum.okta.com/u/grayson.langford)\
**Replies:** 2\
**Last updated:** [December 21, 2022, 7:05pm UTC](https://devforum.okta.com/t/sharing-authentication-with-another-domain/22476 "2022-12-21T19:05:13Z")

</div>

Hello, I have two apps: a.mydomain.com, and b.mydomain.com. When I login to one app, I would like to also be logged into the other without having to re-authenticate. Is sharing authentication with another domain possibl…

---

## [Okta access token exp](https://devforum.okta.com/t/okta-access-token-exp/22611)

<div class="topic-metadata">

**Author:** [@kapple](https://devforum.okta.com/u/kapple)\
**Replies:** 2\
**Last updated:** [November 30, 2022, 5:39pm UTC](https://devforum.okta.com/t/okta-access-token-exp/22611 "2022-11-30T17:39:26Z")

</div>

Hi – I recently came across an issue where a user had an incorrect time zone on their machine. Their client and server time did not match and therefore the current time was always past the expiry time of the token. How…

---

## [Okta Sig Out / Logout in PHP or Javascript](https://devforum.okta.com/t/okta-sig-out-logout-in-php-or-javascript/21806)

<div class="topic-metadata">

**Author:** [@denis.futida](https://devforum.okta.com/u/denis.futida)\
**Replies:** 7\
**Last updated:** [September 8, 2022, 9:10pm UTC](https://devforum.okta.com/t/okta-sig-out-logout-in-php-or-javascript/21806 "2022-09-08T21:10:55Z")

</div>

Hello guys, Can someone send me code, preferably in PHP or Vanilla Javascript for Okta’s Sign Out / Logout, for me to insert in the code of my web application in PHP? I couldn’t implement any of the Sign Out code that i…

---

## [Best way to have 1 front controller for 2 okta applications](https://devforum.okta.com/t/best-way-to-have-1-front-controller-for-2-okta-applications/20784)

<div class="topic-metadata">

**Author:** [@adrianopinaffo](https://devforum.okta.com/u/adrianopinaffo)\
**Replies:** 4\
**Last updated:** [May 27, 2022, 1:00pm UTC](https://devforum.okta.com/t/best-way-to-have-1-front-controller-for-2-okta-applications/20784 "2022-05-27T13:00:50Z")

</div>

I created one front controller (for a REST API) for my okta application. I followed this article and it works fine for machine-to-machine communications. The authenticate() function in my index.php looks like this: func…

---

## [MFA using our own custom UI](https://devforum.okta.com/t/mfa-using-our-own-custom-ui/9923)

<div class="topic-metadata">

**Author:** [@vivekprm](https://devforum.okta.com/u/vivekprm)\
**Replies:** 13\
**Last updated:** [September 3, 2020, 7:10pm UTC](https://devforum.okta.com/t/mfa-using-our-own-custom-ui/9923 "2020-09-03T19:10:38Z")

</div>

I am using AuthJS and have custom login form, which is working fine. When I enable MFA for my user, after login I am being redirected to OKTA hosted factor screen. Instead I want to use my own custom screen. I saw in on…
