-
Notifications
You must be signed in to change notification settings - Fork 94
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
Can't construct an IdTokenResponse from a AuthResponse that has a token type of "access_token #268
Comments
Hello, I have the same problem |
I am facing the same issue. Even after downgrading msal to 1.2.1, I still face the issue. Any help would be appreciated. |
I'm also facing this issue: Current versions: Current setup:
|
I have the same problem as well |
Confirming that downgrading to 1.2.1 fixes it for me. Here's my config if it helps anyone. // Msal Configurations
const config = {
auth: {
authority: `https://login.microsoftonline.com/${tenantId}`,
clientId,
redirectUri: window.location.origin,
},
cache: {
cacheLocation: "localStorage",
storeAuthStateInCookie: true,
},
};
// Authentication Parameters
const authenticationParameters = {
scopes: [`${clientId}/.default`],
};
// Options
const options = {
loginType: LoginType.Popup,
tokenRefreshUri: window.location.origin + "/auth.html",
};
export const authProvider = new MsalAuthProvider(
config,
authenticationParameters,
options
); |
Is this library still maintained? |
Idk, but the last update was 5 months ago. I'm thinking to use the Microsoft library directly instead of using this in the project I'm working on
@MiniMarker, @andrea-wood, @zuitaom. You tried to downgrade the @suhadev whats your packages versions? |
|
Yeah, downgrading works for me as well. |
Hey all, I've had the same issue and at least on my end its an error on the token refresh. When the token is cached, it had the wrong token type causing a failure. Temp fix that is working for me is to set forceRefresh: true in the authenticationParameters const authenticationParameters = {
scopes: [clientId, etc],
state: location.href.replace(location.hash,""),
forceRefresh: true
} |
@its-miller-time Worked like a charm, thank you very much. |
Hello All, Force refresh and version downgrade didn't work for me. I am facing this on refreshing the page. |
Did you delete node_modules, package lock file and removed the ^ in front of the msal version in package? |
@ingogbe downgrade works for me:-) |
UPDATE: In some instances the
The real issue lies in the token refresh. When the silent token call caches the token, the token_type is not refreshed. This causes a conditional check to fail in this library.
The real issue will be solving the token cache issue, but in the mean time, a better fix I am using is to patch the dependency directly to check if a token exists rather than for the tokenType. (You can add better logic to check if an idToken exists in the object if you want to be really safe). if (!response.tokenType) { This is the library I used for the patch: https://github.com/ds300/patch-package#readme |
Temporary fix should be to downgrade the "msal": "~1.3.0", // run npm install |
I got this error after implementing the msal-browser library and switching to a different branch. Clearing the cache or setting |
Library versions
react-aad-msal
: 2.3.5msal
: 1.4.0Describe the bug
I got this message in the console
[ERROR] Error: Can't construct an IdTokenResponse from a AuthResponse that has a token type of "access_token".
when I refresh the page after I'm logged. In Redux the actionAAD_ACQUIRED_ACCESS_TOKEN_SUCCESS
also is fired right afterAAD_INITIALIZING
. I tried to track it down, and it appears to crash on thegetIdToken
function.Expected behavior
The flux I use in my project is to try to get the access token only after the action
AAD_LOGIN_SUCCESS
is called. But I started to get the error I described above, on console, and all others steps failed too (AAD_LOGIN_ERROR
,AAD_ACQUIRED_ID_TOKEN
)The expected is to complete the login when has a current session after the page is reloaded.
To Reproduce
Steps to reproduce the behavior:
Solution:
The temporary solution I found and it worked for me, was to downgrade the
msal
version to the same used on this repository (react-aad
), version1.2.1
Desktop:
The text was updated successfully, but these errors were encountered: