perarnborg / vuex-oidc

Vuejs (with vuex) wrapper for open id authentication
MIT License
232 stars 65 forks source link

access_token undefined #181

Closed adam-kw closed 2 years ago

adam-kw commented 2 years ago

Hi, I have a problem with my custom openid provider it seems that getting access_token from the provider is not working as expected.

My configuration: export const oidcSettings = { authority: 'https://**********/', clientId: '*******', redirectUri: 'http://localhost:8080/callback', responseType: 'id_token token', scope: 'openid profile', }

After successful authentication to my provider I can see in chrome that access_token is received with id_token and token_type image

But when Im trying to access it in store index.js: modules: { oidcStore: vuexOidcCreateStoreModule(oidcSettings, {},{ userLoaded(user) { console.log(user) axios.defaults.headers.common['Authorization'] = 'Bearer ' + user.access_token; }, userUnloaded() { axios.defaults.headers.common['Authorization'] = null; } }) },

console.log(user): image

Its undefined and I dont know why.