Replies: 1 comment 2 replies
-
What about a new attribute proxy {
backend = "rs"
unexpected_status = [401]
}
error_handler "unexpected_status" {
# start token retrieval process
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I thought about Couper as a BFF (backend for frontend), with Couper authorizing requests by an SPA to a resource server (RS).
The RS responds to unauthorized requests with
401
. Couper then should somehow handle this situation by starting a token retrieval process eventually requesting an access token from the authorization server (AS), storing the token as a cookie in the browser, and then "translating" the cookie in the SPA's resource requests into anAuthorization: Bearer
header.Now the question is: How can I configure Couper to handle a specific (error) status code?
I tried using
expected_status
:But I have to list every status code that the RS can return apart from authorization problems, so that only the authorization problem is handled by the
error_handler "unexpected_status" {}
.Any idea how to solve this differently?
Beta Was this translation helpful? Give feedback.
All reactions