Skip to content

Is there an option for openid-connect plugin passing all requests to an upstream if no token provided? #5349

Answered by purefun
purefun asked this question in Q&A
Discussion options

You must be logged in to vote

It's impossible to pass requests to the upstream if token is not provided.

if conf.bearer_only then
-- Token strictly required in request.
ngx.header["WWW-Authenticate"] = 'Bearer realm="' .. conf.realm .. '"'
return ngx.HTTP_UNAUTHORIZED, "No bearer token found in request.", nil, nil

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@starsz
Comment options

starsz Nov 3, 2021
Collaborator

@purefun
Comment options

Answer selected by starsz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants