Skip to content
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

AJAX requests with the oidc golib and keymaster #145

Open
atran-brex opened this issue Jan 27, 2022 · 2 comments
Open

AJAX requests with the oidc golib and keymaster #145

atran-brex opened this issue Jan 27, 2022 · 2 comments

Comments

@atran-brex
Copy link

We have a service using the oidc golib package and keymaster for auth and would like to make AJAX requests to the service from a client-side JS app.

Currently, if the user has not gone through the auth flow to get a cookie set for the service, our AJAX POST request to the service will get redirected to the keymaster login, which will proceed to get blocked by CORS as it has no CORS headers on the response and prevent the browser from showing anything about the response.

Is there any way we could either set those headers for keymaster (not sure if thats actually what we want or how the flow would work in that case), be able to go through the flow in an iframe, or have the oidc golib package return a 401 Unauthorized with a link to the keymaster auth on AJAX requests (denoted by some header) so that we can manually redirect the user?

@cviecco
Copy link
Contributor

cviecco commented Jan 27, 2022

keymasterd already supports CORS iff the PKCE auth0 client is enabled (not by default). It seems like you have an JS app that also tries to login. Please enable this flow and if it does not work please write down the message flow so that I understand the issue.

At this moment I think is just missing configuration (I know bad docs). Please let us know if this fixes your issues.

@rgooch
Copy link
Member

rgooch commented Feb 24, 2022

@atran-brex Ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants