-
Notifications
You must be signed in to change notification settings - Fork 2
/
oidc_idp.conf
158 lines (123 loc) · 4.87 KB
/
oidc_idp.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# ---------------------------------------------------------------------------- #
# #
# IDP Configuration for OpenID Connect #
# (within http block) | #
# | #
# http { | #
# : | #
# +--------------------------+ | #
# | include "oidc_idp.conf"; | <--+ #
# +--------------------------+ #
# : #
# server { #
# : #
# } #
# : #
# } #
# #
# - This file is to configure IDP related info to handle OIDC workflow. #
# - Each map block allows multi values so that multiple IdPs can be supported. #
# #
# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #
# 1. OpenID Provider(IDP) Metadata Configuration via Well-Known Endpoints #
# ---------------------------------------------------------------------------- #
map $x_client_id $idp_region {
default "{{Edit-IdP-Region}}"; # edit for Amazon Cognito (E.g., "us-east-2")
}
map $x_client_id $idp_domain {
default "auth.pingone.us"; # "{{Edit-IdP-Domain}}";
}
map $x_client_id $idp_user_pool_id {
default "{{Edit-User-Pool-ID}}"; # edit for Amacon Cognito
}
map $x_client_id $idp_env_id {
default "{{Edit-IdP-Environment-ID}}"; # edit for Ping Identity
}
map $x_client_id $oidc_authz_endpoint {
default https://$idp_domain/$idp_env_id/as/authorize;
}
map $x_client_id $oidc_jwt_keyfile {
default https://$idp_domain/$idp_env_id/as/jwks;
}
map $x_client_id $oidc_logout_endpoint {
default https://$idp_domain/$idp_env_id/as/signoff;
}
map $x_client_id $oidc_token_endpoint {
default https://$idp_domain/$idp_env_id/as/token;
}
map $x_client_id $oidc_userinfo_endpoint {
default https://$idp_domain/$idp_env_id/as/userinfo;
}
map $x_client_id $oidc_scopes {
default "openid+profile+email";
}
# ---------------------------------------------------------------------------- #
# 2. Custom Configuration for Well-Known OIDC Endpoints #
# ---------------------------------------------------------------------------- #
map $x_client_id $oidc_authz_path_params_enable {
default 0;
}
map $x_client_id $oidc_authz_path_params {
default "";
}
map $x_client_id $oidc_authz_query_params_enable {
default 0;
}
map $x_client_id $oidc_authz_query_params {
default "";
}
map $x_client_id $oidc_logout_path_params_enable {
default 0;
}
map $x_client_id $oidc_logout_path_params {
default "";
}
map $x_client_id $oidc_logout_query_params_enable {
default 0; # 0: OIDC RP-initiated logout, 1: custom logout
}
map $x_client_id $oidc_logout_query_params {
default "";
}
map $x_client_id $oidc_token_path_params_enable {
default 0;
}
map $x_client_id $oidc_token_path_params {
default "";
}
map $x_client_id $oidc_token_query_params_enable {
default 0;
}
map $x_client_id $oidc_token_query_params {
default "";
}
map $x_client_id $oidc_token_header_params_enable {
default 1;
}
map $x_client_id $oidc_token_header_params {
default '{
"Accept-Encoding": "gzip"
}';
}
# ---------------------------------------------------------------------------- #
# 3. Advanced OIDC Configuration #
# ---------------------------------------------------------------------------- #
map $x_client_id $oidc_client {
default "{{Edit-your-client-ID}}";
}
map $x_client_id $oidc_pkce_enable {
default 1;
}
map $x_client_id $oidc_client_secret {
default "{Edit-your-client-secret-unless-pkce-enabled}";
}
map $x_client_id $oidc_logout_redirect {
default "/_logout"; # This is called by IdP after successful logout.
}
map $x_client_id $oidc_hmac_key {
default "ChangeMe"; # This should be unique for every NGINX instance/cluster
}
map $x_client_id $oidc_app_name {
default "{edit-your-idp-app-name}";
}
# vim: syntax=nginx