-
Notifications
You must be signed in to change notification settings - Fork 38
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
Error: Could not read access token #7
Comments
I found out that in setToken function u have const setToken = (token) => { And in my token there is no "realm_access" key |
i have same problem , tried to setup the token in axiosApiInstance.interceptors.request.use( |
any update on this ? |
Hello @dawid096 & @akhi-ninja for reporting! @hirsch88 : what do you think, do we need any additional information or do we have current plans to (soonish) address this? |
I have the same problem. How to catch the error? |
I had Uncaught (in promise) Error: Could not read access token How to do this in keycloak Maybe plugin should have some optional chaining in in setToken function |
Same issue |
1 similar comment
Same issue |
Had the same issue. Error: Could not read access token. This solved the problem in my case. https://www.keycloak.org/docs/latest/securing_apps/#keycloak-server-configuration
Was checked on this fork: https://github.com/JoseGoncalves/vue-keycloak |
Hello,
I have problem when I implement vueKeycloak to my Vue 3 project.
I implement basic config options (options does work in keycloak-js library) and on page load after few seconds I get error in console
Uncaught (in promise) Error: Could not read access token
at initKeycloak (index.esm.js?08aa:98)
at async Object.install (index.esm.js?08aa:156)
this is where i get this error:
async function initKeycloak(initConfig) {
try {
isPending(true);
const _isAuthenticated = await $keycloak.init(initConfig);
isAuthenticated(_isAuthenticated);
if (!isNil($keycloak.token)) {
setToken($keycloak.token);
}
$keycloak.onAuthRefreshSuccess = () => setToken($keycloak.token);
$keycloak.onTokenExpired = () => updateToken();
}
catch (error) {
hasFailed(true);
isAuthenticated(false);
throw new Error('Could not read access token');
}
finally {
isPending(false);
}
}
Do you have any idea why do I have this error?
The text was updated successfully, but these errors were encountered: