Authorization header with access token not included on useHttp() calls in SSR context. #98
Replies: 8 comments
-
I've updated the nuxt-alt/http module check to see if that works for you |
Beta Was this translation helpful? Give feedback.
-
I updated to 1.7.5 but no luck, still same behavior.
And this are the headers from SSR call:
This is the call |
Beta Was this translation helpful? Give feedback.
-
What does your config look like |
Beta Was this translation helpful? Give feedback.
-
Edit: Added whole config |
Beta Was this translation helpful? Give feedback.
-
update the http module again |
Beta Was this translation helpful? Give feedback.
-
Running with @nuxt-alt/http 1.7.6 but still the same. I can take a look / debug for myself but I have no idea where to look 😄 Found also some other quirk, the get token http call on the client side doesn't take account the prefix parameter, the oidc configuration http call does. Also no pressure, I got everything working without SSR. SSR is no requirement for this project. |
Beta Was this translation helpful? Give feedback.
-
I'm completely unfamiliar with openid, I've only dealt with oauth and the local auth. If you're trying to find the headers during proxy you'd do something like: proxy: {
proxies: {
'/api': {
target: '<url>',
configure: (proxy) => {
proxy.on('proxyReq', (proxyReq) => {
console.log(proxyReq)
})
}
},
}
}, and try to see what headers are there. Can you elaborate more on this: Found also some other quirk, the get token http call on the client side doesn't take account the prefix parameter, the oidc configuration http call does. it very well could be something I forgot to take into account with the refactor I did. |
Beta Was this translation helpful? Give feedback.
-
I've updated the http module to handle debugging in the nitro portion of nuxt. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I did configure nuxt-alt/auth with our own OpenID server with OpenID Connect. That is now up and running. But we found that the http calls using nuxt-alt/http on the server when using SSR do miss the Authorization: Bearer header, and causes the backend (proxied through nuxt-alt/rpxy) to return 401 (what is of course obvious).
Is there something what I miss?
Beta Was this translation helpful? Give feedback.
All reactions