okta / okta-auth-js

The official js wrapper around Okta's auth API
Other
454 stars 267 forks source link

Storage configuration #940

Open jpspringall opened 3 years ago

jpspringall commented 3 years ago

There looks to be 2 ways of configuring token storage:

Using the storageManager:

storageManager: {
    token: {
          storageType: 'sessionStorage',
    }
} 

Using token manager storage property:

tokenManager: {
    storage: 'sessionStorage'
}

I can see that token manager storage property is used to set the storage manager token property So it looks like the the storagemanager option is the preferred methodand gives more flexibility.

If this is the case are there any complaints if I update the example client to use the use storageManager rather than token manager? This is because like me, I suspect most people copied and pasted the example client as the starting point, so may as well implement the preferred option.

Thanks

James

denysoblohin-okta commented 3 years ago

tokenManager.storage can be used to override storageManager.token.storageType/storageProvider. Using tokenManager.storage is simpler way to configure token storage, using storageManager is more advanced