Skip to content

Commit

Permalink
README.md: provide a more complete OAuth2Require example; thanks @pladen
Browse files Browse the repository at this point in the history


see: 76102f0#commitcomment-143397829

Signed-off-by: Hans Zandbelt <[email protected]>
  • Loading branch information
zandbelt committed Jun 21, 2024
1 parent 76102f0 commit 872b96e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ OAuth2TokenVerify [ introspect | jwk_uri | metadata | jwk | plain | base64 | bas
"~*^Bearer\s+(?<token>[\S]+)$" $token;
}
map $pfc_introspect_sub $valid_sub_joe {
"joe" 1;
map $pfc_introspect_sub $valid_sub {
"joe" 1;
"alice" 1;
"bob" 1;
"~admin_.+" 1; #allow
"~student_.+" 0; # deny
default 0; # default to deny
}
server {
Expand All @@ -45,7 +50,7 @@ OAuth2TokenVerify [ introspect | jwk_uri | metadata | jwk | plain | base64 | bas
OAuth2Claim username $pfc_introspect_username;
OAuth2Claim active $pfc_introspect_active;
OAuth2Require $valid_sub_joe;
OAuth2Require $valid_sub;
proxy_set_header OAUTH2_CLAIM_sub $pfc_introspect_sub;
proxy_set_header OAUTH2_CLAIM_username $pfc_introspect_username;
Expand Down

0 comments on commit 872b96e

Please sign in to comment.