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 (#80)
- 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
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,7 @@ func main() {
89
89
varoidcProviderNamestring
90
90
varoidcAllowedUsersstring
91
91
varoidcAllowedUsersGlobstring
92
+
varnoProviderAutoSelectbool
92
93
varpasswordstring
93
94
varpasswordHashstring
94
95
varproxyBearerTokenstring
@@ -195,6 +196,7 @@ func main() {
195
196
oidcProviderName,
196
197
oidcAllowedUsersList,
197
198
oidcAllowedUsersGlobList,
199
+
noProviderAutoSelect,
198
200
password,
199
201
passwordHash,
200
202
trustedProxiesList,
@@ -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