Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store the access_token in the localStorage #2078

Closed
ChengYanJin opened this issue Nov 26, 2019 · 0 comments
Closed

Store the access_token in the localStorage #2078

ChengYanJin opened this issue Nov 26, 2019 · 0 comments
Assignees
Labels
complexity:medium Something that requires one or few days to fix topic:authentication Anything related to user authentication topic:ui UI-related issues

Comments

@ChengYanJin
Copy link
Contributor

ChengYanJin commented Nov 26, 2019

Component: Dex, ui

Why this is needed:
After login, if we open another tab in the same browser, we are redirected to the login page again.

What should be done:

The hint is to change the user data into localStorage instead of sessionStorage, which is the current case for redux-oidc library. (But we still need to investigate if this is the real issue)

const userManagerSettings = {
...,
userStore: new WebStorageStateStore({ store: localStorage})
}

According to the suggestion of the redux-oidc git, we will need to look at the oidc-client documentation when configuring the userManager.

oidc-client documentation
https://github.com/IdentityModel/oidc-client-js/wiki#configuration

userStore: (default: session storage): Storage object used to persist User for currently authenticated user. E.g. userStore: new WebStorageStateStore({ store: window.localStorage })

Implementation proposal (strongly recommended):
TBD

Test plan:
TBD

@ChengYanJin ChengYanJin added moonshot topic:ui UI-related issues complexity:medium Something that requires one or few days to fix topic:authentication Anything related to user authentication labels Nov 26, 2019
@ChengYanJin ChengYanJin self-assigned this Nov 29, 2019
@ChengYanJin ChengYanJin added this to To do in Authentication via automation Nov 29, 2019
@ChengYanJin ChengYanJin moved this from To do to In progress in Authentication Nov 29, 2019
ChengYanJin added a commit that referenced this issue Nov 29, 2019
We need to use WebStorageStateStore provided by oidc-client in
order to store the credential in localStorage.

Refs: #2078
ChengYanJin added a commit that referenced this issue Nov 29, 2019
We will want to share the user crediential across different tabs.
By default redux-oidc storge access_token in sessionStorge,
in this PR we will change it to localStorage.

Refs: #2078
ChengYanJin added a commit that referenced this issue Nov 29, 2019
We need to use WebStorageStateStore provided by oidc-client in
order to store the credential in localStorage.

Refs: #2078
ChengYanJin added a commit that referenced this issue Nov 29, 2019
We will want to share the user crediential across different tabs.
By default redux-oidc storge access_token in sessionStorge,
in this PR we will change it to localStorage.

Refs: #2078
@gdemonet gdemonet added this to In progress in Week 49/2019 Dec 2, 2019
@thomasdanan thomasdanan added this to the MetalK8s 2.5.0 milestone Dec 5, 2019
ChengYanJin added a commit that referenced this issue Dec 8, 2019
We need to use WebStorageStateStore provided by oidc-client in
order to store the credential in localStorage.

Refs: #2078
ChengYanJin added a commit that referenced this issue Dec 8, 2019
We will want to share the user crediential across different tabs.
By default redux-oidc storge access_token in sessionStorge,
in this PR we will change it to localStorage.

Refs: #2078
ChengYanJin added a commit that referenced this issue Dec 8, 2019
We need to use WebStorageStateStore provided by oidc-client in
order to store the credential in localStorage.

Refs: #2078
ChengYanJin added a commit that referenced this issue Dec 8, 2019
We will want to share the user crediential across different tabs.
By default redux-oidc storge access_token in sessionStorge,
in this PR we will change it to localStorage.

Refs: #2078
ChengYanJin added a commit that referenced this issue Dec 9, 2019
We need to use WebStorageStateStore provided by oidc-client in
order to store the credential in localStorage.

Refs: #2078
ChengYanJin added a commit that referenced this issue Dec 9, 2019
We will want to share the user crediential across different tabs.
By default redux-oidc storge access_token in sessionStorge,
in this PR we will change it to localStorage.

Refs: #2078
ChengYanJin added a commit that referenced this issue Dec 9, 2019
We will want to share the user crediential across different tabs.
By default redux-oidc storge access_token in sessionStorge,
in this PR we will change it to localStorage.

Refs: #2078
@gdemonet gdemonet added this to In progress in Week 50/2019 Dec 10, 2019
Authentication automation moved this from In progress to Done Dec 11, 2019
Week 49/2019 automation moved this from In progress to Done Dec 11, 2019
Week 50/2019 automation moved this from In progress to Done Dec 11, 2019
ChengYanJin added a commit that referenced this issue Dec 17, 2019
We will want to share the user crediential across different tabs.
By default redux-oidc storge access_token in sessionStorge,
in this PR we will change it to localStorage.

Refs: #2078
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity:medium Something that requires one or few days to fix topic:authentication Anything related to user authentication topic:ui UI-related issues
Projects
Week 49/2019
  
Done
Week 50/2019
  
Done
Development

No branches or pull requests

2 participants