Skip to content

Commit d7fc387

Browse files
authored
Merge pull request sameersbn#2849 from massej/massej/oauth_allow_bypass_two_factor
Added missing configuration variable OAUTH_ALLOW_BYPASS_TWO_FACTOR.
2 parents 800dae7 + e574613 commit d7fc387

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,6 +2023,10 @@ Allow users with existing accounts to login and auto link their account via the
20232023

20242024
Comma separated list if oauth providers to disallow access to `internal` projects. Users creating accounts via these providers will have access internal projects. Accepted values are `cas3`, `github`, `bitbucket`, `gitlab`, `google_oauth2`, `facebook`, `twitter`, `saml`, `crowd`, `auth0` and `azure_oauth2`. No default.
20252025

2026+
##### `OAUTH_ALLOW_BYPASS_TWO_FACTOR`
2027+
2028+
Specify oauth providers where users can sign in without using two-factor authentication (2FA). You can define this using an array of providers like `["twitter", "google_oauth2"]`. Setting this to `true` or `false` applies to all - allow all or none. Defaults to `false`.
2029+
20262030
##### `OAUTH_CAS3_LABEL`
20272031

20282032
The "Sign in with" button label. Defaults to "cas3".

assets/runtime/config/gitlabhq/gitlab.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ production: &base
918918
# This option should only be configured for providers which already have two factor.
919919
# This configration dose not apply to SAML.
920920
# (default: false)
921-
allow_bypass_two_factor: null
921+
allow_bypass_two_factor: {{OAUTH_ALLOW_BYPASS_TWO_FACTOR}}
922922

923923
## Auth providers
924924
# Uncomment the following lines and fill in the data of the auth provider you want to use

assets/runtime/env-defaults

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ OAUTH_BLOCK_AUTO_CREATED_USERS=${OAUTH_BLOCK_AUTO_CREATED_USERS:-true}
426426
OAUTH_AUTO_LINK_LDAP_USER=${OAUTH_AUTO_LINK_LDAP_USER:-false}
427427
OAUTH_AUTO_LINK_SAML_USER=${OAUTH_AUTO_LINK_SAML_USER:-false}
428428
OAUTH_EXTERNAL_PROVIDERS=${OAUTH_EXTERNAL_PROVIDERS:-}
429+
OAUTH_ALLOW_BYPASS_TWO_FACTOR=${OAUTH_ALLOW_BYPASS_TWO_FACTOR:-false}
429430

430431
### GOOGLE
431432
OAUTH_GOOGLE_API_KEY=${OAUTH_GOOGLE_API_KEY:-}

assets/runtime/functions

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,8 @@ gitlab_configure_oauth() {
819819
OAUTH_AUTO_LINK_LDAP_USER \
820820
OAUTH_AUTO_LINK_SAML_USER \
821821
OAUTH_AUTO_LINK_USER \
822-
OAUTH_EXTERNAL_PROVIDERS
822+
OAUTH_EXTERNAL_PROVIDERS \
823+
OAUTH_ALLOW_BYPASS_TWO_FACTOR
823824

824825
case ${OAUTH_AUTO_SIGN_IN_WITH_PROVIDER} in
825826
cas3|google_oauth2|facebook|twitter|github|gitlab|bitbucket|saml|crowd|azure_oauth2|azure_activedirectory_v2|oauth2_generic|$OAUTH2_GENERIC_NAME)

contrib/docker-swarm/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ services:
9999
- OAUTH_AUTO_LINK_LDAP_USER=false
100100
- OAUTH_AUTO_LINK_SAML_USER=false
101101
- OAUTH_EXTERNAL_PROVIDERS=
102+
- OAUTH_ALLOW_BYPASS_TWO_FACTOR=false
102103

103104
- OAUTH_CAS3_LABEL=cas3
104105
- OAUTH_CAS3_SERVER=

0 commit comments

Comments
 (0)