Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cors Response does not have Origin headers on 401/500 errors #1335

Unanswered
jsona91 asked this question in Q&A
Discussion options

Hi All,

I have setup as below. When client calls protected link using Cors then if there is any error like refreshing token Or access token is expired then mod_auth_openidc returns 401 or 500 back to client. But it does not return Access-Control-Allow-Origin in Response back to client. In successful access token validation of cors requests, it does returns Access-Control-Allow-Origin back to client in Response.

So can you please suggest how can Access-Control-Allow-Origin returned back on error in Response.

<Location /protected1>
AuthType openid-connect
Require valid-user
OIDCUnAuthAction auth true

<Location /protected2>
AuthType openid-connect
Require valid-user
OIDCUnAuthAction 401

In case of /protected2 endponint, if OIDCUnAuthAction fails with 401 then it does not return Access-Control-Allow-Origin returned back to client in Response.

Thanks

You must be logged in to vote

Replies: 1 comment

Comment options

assuming you're setting those headers yourself, you'll need to apply the always attribute to add the headers to error responses as well as "successful" responses, i.e. use Header always set

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /