Comments (13)
Omg, that is a very good thing to know. I changed ${initialState.settings.AppContextPath}/callback
to ${initialState.settings.AppContextPath}callback
and it now works. This was driving me crazy the last few days!
Danke
from redux-oidc.
What is the error message you're getting? Haven't updated my projects yet, will investigate over the weekend.
from redux-oidc.
No error message, I'm just stuck at the callback page
from redux-oidc.
Just upgraded my example app to oidc-client version 1.3.0 and the callback worked fine. Are you sure this isn't an issue on your side?
from redux-oidc.
Ok, will look into it. Might be the auth-wrapper
from redux-oidc.
Keep me posted in case your issue is somehow related to redux-oidc or its integration with the auth-wrapper.
from redux-oidc.
Turned out that error occurred due to the newly added sub validation in oidc-client-js IdentityModel/oidc-client-js#302
from redux-oidc.
I am also stuck in the /callback page.
Console error:
There was an error handling the token callback: No matching state found in storage Error: No matching state found in storage
This only happens when I include the oidcMiddleware using
console.log('1', window.localStorage);
const oidcMiddleware = createOidcMiddleware(userManager, () => true, false, `${initialState.settings.AppContextPath}/callback`);
console.log('2', window.localStorage);
And include it in the store. When I log window.localStorage, the localStorage is empty after creating the middleware.
I am using v2.2.1 of redux-oidc and 1.2.2 of oidc-client-js.
from redux-oidc.
Clearing localStorage is the desired behavior to remove failed callback states put there by oidc-client. Can you share your userManager config?
from redux-oidc.
The userManager is created via a helper function:
export const setupUserManager = (systemSettings) => {
const portPart = window.location && window.location.port ? `:${window.location.port}` : '';
const absoluteBasePath = `${window.location.protocol}//${window.location.hostname}${portPart}${systemSettings.AppContextPath}`;
const userManagerConfig = {
/* REQUIRED */
authority: systemSettings.AuthAuthorityURI,
client_id: 'client',
redirect_uri: `${absoluteBasePath}callback`,
response_type: 'token id_token',
scope: 'openid profile email',
/* OPTIONAL */
logout_redirect_uri: `${absoluteBasePath}error`,
automaticSilentRenew: true,
silent_redirect_uri: `${absoluteBasePath}silent_renew.html`,
filterProtocolClaims: true,
loadUserInfo: true
};
return new UserManager(userManagerConfig);
};
When redirecting from my login page to the central login, I see the oidc.[...] in the localstorage being set correctly. When I was successfully authenticated, I get redirected to the callback page but when creating the middleware, the storage gets deleted before the CallbackBack (with the CallbackComponent) can do it's signinRedirectCallback.
I think that is why it cannot find the state.
EDIT: I checked it again, without the creation of the oidcMiddleware (using createOidcMiddleware), the login works and the localStorage does not get cleared. Log 2*22 still logs the correct localStorage.
from redux-oidc.
From your config it looks like you're using the default storage mechanism of the userManager
which is sessionStorage
. localStorage
is only used to manage redirection by the userManager
. The middleware clears this temporary data when the current URL of your app is not equal to the argument you pass into the creator function - ${initialState.settings.AppContextPath}/callback
in your case. This is done to clear out any leftover data of failed login attempts and to avoid an unnecessary overflow of localStorage
.
If your login worked you can look into sessionStorage
and see the data there. From afar, I guess that whatever ${initialState.settings.AppContextPath}/callback
resolves to is not equal to the actual callback URL of your app.
from redux-oidc.
FYI - the reason for clearing localStorage
is because of this bug.
from redux-oidc.
Immer gerne :)
from redux-oidc.
Related Issues (20)
- LOADING_USER called multiple times from my reducers
- User signed out when calling silent renew HOT 1
- access_token is undefined in user object HOT 1
- user State is not getting maintained between browser tabs HOT 2
- Error when automatically trying to reauthenticate HOT 1
- Using the library with authorization code + PKCE HOT 1
- How to store the auth token in a cookie called 'token'? HOT 1
- Passing runtime configuration to UserManager HOT 1
- On redirect, LOADING_USER and USER_EXPIRED fires just before USER_FOUND HOT 1
- errorCallback called right after successCallback in Google Chrome and Edge HOT 5
- Redux state changed to Loading_user , User_Expired, User_found HOT 1
- Update UserManager authority after creation? HOT 1
- Google OAuth: Refresh token not present in token response HOT 7
- Passing state from signinRedirect to successCallback
- Manually update the oidcUser object with extra info
- Multiple-Apps-And-One-IdentityServer
- React js version 18 typescripts issue HOT 4
- Switch oidc-client to oidc-client-ts HOT 1
- redux-oidc(4.0.0-beta1) onSuccessCallback - redirect is not working HOT 1
- Support for React 18? HOT 17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redux-oidc.