okta-auth-js icon indicating copy to clipboard operation
okta-auth-js copied to clipboard

Custom localStorage or cookie name

Open tonywong625 opened this issue 6 years ago • 4 comments
trafficstars

Is it possible to issue a custom name for local storage or cookie?

okta-token-storage to something different.

Reason is that we dont want user to know what our login system is.

tonywong625 avatar Apr 18 '19 01:04 tonywong625

Does this meet your needs? https://github.com/okta/okta-auth-js/blob/master/package.json#L61

Questions (as opposed to bug reports or feature requests) about the SDKs are better directed at https://devforum.okta.com/

Hope that helps! Closing this issue, but if that doesn't work for you and you have a bug report/feature request related to this, feel free to re-open this issue or create a new one.

swiftone avatar Apr 24 '19 21:04 swiftone

I tried adding

  "okta-auth-js": {
    "STATE_TOKEN_KEY_NAME": "customNameStateToken",
    "DEFAULT_POLLING_DELAY": 500,
    "DEFAULT_MAX_CLOCK_SKEW": 300,
    "DEFAULT_CACHE_DURATION": 86400,
    "FRAME_ID": "customName-oauth-helper-frame",
    "REDIRECT_OAUTH_PARAMS_COOKIE_NAME": "customName-oauth-redirect-params",
    "REDIRECT_STATE_COOKIE_NAME": "customName-oauth-state",
    "REDIRECT_NONCE_COOKIE_NAME": "customName-oauth-nonce",
    "TOKEN_STORAGE_NAME": "customName-token-storage",
    "CACHE_STORAGE_NAME": "customName-cache-storage"
  }

into the root package.json file but nothing is happening

tonywong625 avatar Apr 28 '19 22:04 tonywong625

auth-js doesn't support such customization today. as work around, you have to fork and build your own version

haishengwu-okta avatar May 01 '19 19:05 haishengwu-okta

Nowadays you can do it easily:

https://github.com/okta/okta-auth-js#storagekey

mica16 avatar Jul 14 '21 19:07 mica16