You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(auth): add no-provider-auto-select flag to disable auto-redirect
- Add noProviderAutoSelect to AuthRouter and mcp-proxy Run
- Skip auto-redirect to the sole provider when no password is set
- Update docs and tests to cover behavior
Notes: This adds a new parameter to exported constructors; call sites pass the flag.
|`--no-provider-auto-select`|`NO_PROVIDER_AUTO_SELECT`|`false`| Disable auto-redirect when only one OAuth/OIDC provider is configured and no password is set |
33
+
|`--password`|`PASSWORD`| - | Plain text password for authentication (will be hashed with bcrypt) |
34
+
|`--password-hash`|`PASSWORD_HASH`| - | Bcrypt hash of password for authentication |
Copy file name to clipboardExpand all lines: main.go
+40-37Lines changed: 40 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -86,9 +86,10 @@ func main() {
86
86
varoidcClientSecretstring
87
87
varoidcScopesstring
88
88
varoidcUserIDFieldstring
89
-
varoidcProviderNamestring
90
-
varoidcAllowedUsersstring
91
-
varoidcAllowedUsersGlobstring
89
+
varoidcProviderNamestring
90
+
varoidcAllowedUsersstring
91
+
varoidcAllowedUsersGlobstring
92
+
varnoProviderAutoSelectbool
92
93
varpasswordstring
93
94
varpasswordHashstring
94
95
varproxyBearerTokenstring
@@ -170,40 +171,41 @@ func main() {
170
171
}
171
172
}
172
173
173
-
iferr:=mcpproxy.Run(
174
-
listen,
175
-
tlsListen,
176
-
!noAutoTLS,
177
-
tlsHost,
178
-
tlsDirectoryURL,
179
-
tlsAcceptTOS,
180
-
dataPath,
181
-
externalURL,
182
-
googleClientID,
183
-
googleClientSecret,
184
-
googleAllowedUsersList,
185
-
googleAllowedWorkspacesList,
186
-
githubClientID,
187
-
githubClientSecret,
188
-
githubAllowedUsersList,
189
-
githubAllowedOrgsList,
190
-
oidcConfigurationURL,
191
-
oidcClientID,
192
-
oidcClientSecret,
193
-
oidcScopesList,
194
-
oidcUserIDField,
195
-
oidcProviderName,
196
-
oidcAllowedUsersList,
197
-
oidcAllowedUsersGlobList,
198
-
password,
199
-
passwordHash,
200
-
trustedProxiesList,
201
-
proxyHeadersList,
202
-
proxyBearerToken,
203
-
args,
204
-
); err!=nil {
205
-
panic(err)
206
-
}
174
+
iferr:=mcpproxy.Run(
175
+
listen,
176
+
tlsListen,
177
+
!noAutoTLS,
178
+
tlsHost,
179
+
tlsDirectoryURL,
180
+
tlsAcceptTOS,
181
+
dataPath,
182
+
externalURL,
183
+
googleClientID,
184
+
googleClientSecret,
185
+
googleAllowedUsersList,
186
+
googleAllowedWorkspacesList,
187
+
githubClientID,
188
+
githubClientSecret,
189
+
githubAllowedUsersList,
190
+
githubAllowedOrgsList,
191
+
oidcConfigurationURL,
192
+
oidcClientID,
193
+
oidcClientSecret,
194
+
oidcScopesList,
195
+
oidcUserIDField,
196
+
oidcProviderName,
197
+
oidcAllowedUsersList,
198
+
oidcAllowedUsersGlobList,
199
+
noProviderAutoSelect,
200
+
password,
201
+
passwordHash,
202
+
trustedProxiesList,
203
+
proxyHeadersList,
204
+
proxyBearerToken,
205
+
args,
206
+
); err!=nil {
207
+
panic(err)
208
+
}
207
209
},
208
210
}
209
211
@@ -239,6 +241,7 @@ func main() {
239
241
rootCmd.Flags().StringVar(&oidcAllowedUsersGlob, "oidc-allowed-users-glob", getEnvWithDefault("OIDC_ALLOWED_USERS_GLOB", ""), "Comma-separated list of glob patterns for allowed OIDC users")
240
242
241
243
// Password authentication
244
+
rootCmd.Flags().BoolVar(&noProviderAutoSelect, "no-provider-auto-select", getEnvBoolWithDefault("NO_PROVIDER_AUTO_SELECT", false), "Disable auto-redirect when only one OAuth/OIDC provider is configured and no password is set")
242
245
rootCmd.Flags().StringVar(&password, "password", getEnvWithDefault("PASSWORD", ""), "Plain text password for authentication (will be hashed with bcrypt)")
243
246
rootCmd.Flags().StringVar(&passwordHash, "password-hash", getEnvWithDefault("PASSWORD_HASH", ""), "Bcrypt hash of password for authentication")
0 commit comments