I am trying to implement SSO in my React-Redux application using the OpenID-Connect provider. The goal is to protect all components and redirect the user to the Identity Provider login page if the session ends. That is why I cannot have a special login page (component) in the application. I read that storing JWT in localStorage might be a good idea, so I thought about using the isAuthenticated flag in the Redux store and storing the JWT in localStorage. Then I can get JWTs from localStorage to authenticate other APIs that I call from my application. Is this approach appropriate?
Also, can anyone point me to a library / package that I can use to retrieve (and update) the JWT for this purpose? I went through a lot of documentation and tried the following, but couldn't get them to work:
redux-oidc : I do not have a special callback component in my application, so I donβt quite know how to apply this approach to my application.
passport-openid-connect : The passport relies on storing sessions in cookies, but instead I would like to use localSorage.
redux-auth-wrapper : a higher order component sounds great, but I still can't figure out how to integrate it without any special input component,
Can anyone advise me? I am new to the React ecosystem, so please excuse my misunderstanding.
Any help would be greatly appreciated!
thanks
source share