-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathoidc_idp.conf
145 lines (112 loc) · 4.57 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
# ---------------------------------------------------------------------------- #
# #
# 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}}"; # N/A for Keycloak
}
map $x_client_id $idp_domain {
default "host.docker.internal:8080/auth/realms/master/protocol/openid-connect"; # "{{Edit-IdP-Domain}}";
}
map $x_client_id $idp_user_pool_id {
default "{{Edit-User-Pool-ID}}"; # N/A for Keycloak
}
map $x_client_id $oidc_authz_endpoint {
default http://$idp_domain/auth;
}
map $x_client_id $oidc_jwt_keyfile {
default http://$idp_domain/certs;
}
map $x_client_id $oidc_logout_endpoint {
default http://$idp_domain/logout;
}
map $x_client_id $oidc_token_endpoint {
default http://$idp_domain/token;
}
map $x_client_id $oidc_userinfo_endpoint {
default http://$idp_domain/userinfo;
}
map $x_client_id $oidc_scopes {
default "openid+profile+email+offline_access";
}
# ---------------------------------------------------------------------------- #
# 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 "";
}
# ---------------------------------------------------------------------------- #
# 3. Advanced OIDC Configuration #
# ---------------------------------------------------------------------------- #
map $x_client_id $oidc_client {
default "my-client-id"; # "{{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