Skip to content

Commit 872b96e

Browse files
committed
README.md: provide a more complete OAuth2Require example; thanks @pladen
see: 76102f0#commitcomment-143397829 Signed-off-by: Hans Zandbelt <[email protected]>
1 parent 76102f0 commit 872b96e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@ OAuth2TokenVerify [ introspect | jwk_uri | metadata | jwk | plain | base64 | bas
2424
"~*^Bearer\s+(?<token>[\S]+)$" $token;
2525
}
2626
27-
map $pfc_introspect_sub $valid_sub_joe {
28-
"joe" 1;
27+
map $pfc_introspect_sub $valid_sub {
28+
"joe" 1;
29+
"alice" 1;
30+
"bob" 1;
31+
"~admin_.+" 1; #allow
32+
"~student_.+" 0; # deny
33+
default 0; # default to deny
2934
}
3035
3136
server {
@@ -45,7 +50,7 @@ OAuth2TokenVerify [ introspect | jwk_uri | metadata | jwk | plain | base64 | bas
4550
OAuth2Claim username $pfc_introspect_username;
4651
OAuth2Claim active $pfc_introspect_active;
4752
48-
OAuth2Require $valid_sub_joe;
53+
OAuth2Require $valid_sub;
4954
5055
proxy_set_header OAUTH2_CLAIM_sub $pfc_introspect_sub;
5156
proxy_set_header OAUTH2_CLAIM_username $pfc_introspect_username;

0 commit comments

Comments
 (0)