Skip to content

Commit

Permalink
Enable and Fix keycloak User Registration Config along with defaultin…
Browse files Browse the repository at this point in the history
…g to 'User' group for newly registered users (#24765)

* Fix keycloak User Registration Config along with defaulting to 'User' group for newly registered users.

* Enable User Registration in Keycloak by default
  • Loading branch information
RawSanj authored May 9, 2024
1 parent f56c6a7 commit bef1c4d
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"oauth2DevicePollingInterval": 5,
"enabled": true,
"sslRequired": "external",
"registrationAllowed": false,
"registrationAllowed": true,
"registrationEmailAsUsername": false,
"rememberMe": false,
"verifyEmail": false,
Expand Down Expand Up @@ -463,6 +463,9 @@
"requiredCredentials": [
"password"
],
"defaultGroups": [
"/Users"
],
"otpPolicyType": "totp",
"otpPolicyAlgorithm": "HmacSHA1",
"otpPolicyInitialCounter": 0,
Expand Down Expand Up @@ -2364,6 +2367,14 @@
"priority": 60,
"userSetupAllowed": false,
"autheticatorFlow": false
},
{
"authenticator": "registration-terms-and-conditions",
"authenticatorFlow": false,
"requirement": "DISABLED",
"priority": 70,
"autheticatorFlow": false,
"userSetupAllowed": false
}
]
},
Expand Down Expand Up @@ -2455,9 +2466,9 @@
"config": {}
},
{
"alias": "terms_and_conditions",
"alias": "TERMS_AND_CONDITIONS",
"name": "Terms and Conditions",
"providerId": "terms_and_conditions",
"providerId": "TERMS_AND_CONDITIONS",
"enabled": false,
"defaultAction": false,
"priority": 20,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"oauth2DevicePollingInterval": 5,
"enabled": true,
"sslRequired": "external",
"registrationAllowed": false,
"registrationAllowed": true,
"registrationEmailAsUsername": false,
"rememberMe": false,
"verifyEmail": false,
Expand Down Expand Up @@ -463,6 +463,9 @@
"requiredCredentials": [
"password"
],
"defaultGroups": [
"/Users"
],
"otpPolicyType": "totp",
"otpPolicyAlgorithm": "HmacSHA1",
"otpPolicyInitialCounter": 0,
Expand Down Expand Up @@ -2362,6 +2365,14 @@
"priority": 60,
"userSetupAllowed": false,
"autheticatorFlow": false
},
{
"authenticator": "registration-terms-and-conditions",
"authenticatorFlow": false,
"requirement": "DISABLED",
"priority": 70,
"autheticatorFlow": false,
"userSetupAllowed": false
}
]
},
Expand Down Expand Up @@ -2453,9 +2464,9 @@
"config": {}
},
{
"alias": "terms_and_conditions",
"alias": "TERMS_AND_CONDITIONS",
"name": "Terms and Conditions",
"providerId": "terms_and_conditions",
"providerId": "TERMS_AND_CONDITIONS",
"enabled": false,
"defaultAction": false,
"priority": 20,
Expand Down
42 changes: 32 additions & 10 deletions generators/kubernetes/__snapshots__/kubernetes.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2605,7 +2605,7 @@ data:
"oauth2DevicePollingInterval": 5,
"enabled": true,
"sslRequired": "external",
"registrationAllowed": false,
"registrationAllowed": true,
"registrationEmailAsUsername": false,
"rememberMe": false,
"verifyEmail": false,
Expand Down Expand Up @@ -3027,6 +3027,9 @@ data:
"requiredCredentials": [
"password"
],
"defaultGroups": [
"/Users"
],
"otpPolicyType": "totp",
"otpPolicyAlgorithm": "HmacSHA1",
"otpPolicyInitialCounter": 0,
Expand Down Expand Up @@ -3541,7 +3544,7 @@ data:
"redirectUris": [
"http://jhgate.default.example.com/*",
"https://jhgate.default.example.com/*", "http://localhost:8080/*",
"https://localhost:8080/*",
"https://localhost:8080/*",
"http://localhost:8100/*",
"http://127.0.0.1:8761/*",
"http://localhost:9000/*",
Expand All @@ -3550,7 +3553,7 @@ data:
"webOrigins": [
"http://jhgate.default.example.com",
"https://jhgate.default.example.com", "http://localhost:8080",
"https://localhost:8080",
"https://localhost:8080",
"http://localhost:8100",
"http://127.0.0.1:8761",
"http://localhost:9000"
Expand Down Expand Up @@ -4816,6 +4819,14 @@ data:
"priority": 60,
"userSetupAllowed": false,
"autheticatorFlow": false
},
{
"authenticator": "registration-terms-and-conditions",
"authenticatorFlow": false,
"requirement": "DISABLED",
"priority": 70,
"autheticatorFlow": false,
"userSetupAllowed": false
}
]
},
Expand Down Expand Up @@ -4907,9 +4918,9 @@ data:
"config": {}
},
{
"alias": "terms_and_conditions",
"alias": "TERMS_AND_CONDITIONS",
"name": "Terms and Conditions",
"providerId": "terms_and_conditions",
"providerId": "TERMS_AND_CONDITIONS",
"enabled": false,
"defaultAction": false,
"priority": 20,
Expand Down Expand Up @@ -6019,7 +6030,7 @@ data:
"oauth2DevicePollingInterval": 5,
"enabled": true,
"sslRequired": "external",
"registrationAllowed": false,
"registrationAllowed": true,
"registrationEmailAsUsername": false,
"rememberMe": false,
"verifyEmail": false,
Expand Down Expand Up @@ -6441,6 +6452,9 @@ data:
"requiredCredentials": [
"password"
],
"defaultGroups": [
"/Users"
],
"otpPolicyType": "totp",
"otpPolicyAlgorithm": "HmacSHA1",
"otpPolicyInitialCounter": 0,
Expand Down Expand Up @@ -6955,7 +6969,7 @@ data:
"redirectUris": [
"http://jhgate.default.example.com/*",
"https://jhgate.default.example.com/*", "http://localhost:8080/*",
"https://localhost:8080/*",
"https://localhost:8080/*",
"http://localhost:8100/*",
"http://127.0.0.1:8761/*",
"http://localhost:9000/*",
Expand All @@ -6964,7 +6978,7 @@ data:
"webOrigins": [
"http://jhgate.default.example.com",
"https://jhgate.default.example.com", "http://localhost:8080",
"https://localhost:8080",
"https://localhost:8080",
"http://localhost:8100",
"http://127.0.0.1:8761",
"http://localhost:9000"
Expand Down Expand Up @@ -8230,6 +8244,14 @@ data:
"priority": 60,
"userSetupAllowed": false,
"autheticatorFlow": false
},
{
"authenticator": "registration-terms-and-conditions",
"authenticatorFlow": false,
"requirement": "DISABLED",
"priority": 70,
"autheticatorFlow": false,
"userSetupAllowed": false
}
]
},
Expand Down Expand Up @@ -8321,9 +8343,9 @@ data:
"config": {}
},
{
"alias": "terms_and_conditions",
"alias": "TERMS_AND_CONDITIONS",
"name": "Terms and Conditions",
"providerId": "terms_and_conditions",
"providerId": "TERMS_AND_CONDITIONS",
"enabled": false,
"defaultAction": false,
"priority": 20,
Expand Down
2 changes: 1 addition & 1 deletion generators/kubernetes/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function writeFiles() {
}

this.keycloakRedirectUris += `"http://localhost:${appConfig.composePort}/*",
"https://localhost:${appConfig.composePort}/*", `;
"https://localhost:${appConfig.composePort}/*",`;

if (appConfig.devServerPort !== undefined) {
this.keycloakRedirectUris += `"http://localhost:${appConfig.devServerPort}/*", `;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ data:
"oauth2DevicePollingInterval": 5,
"enabled": true,
"sslRequired": "external",
"registrationAllowed": false,
"registrationAllowed": true,
"registrationEmailAsUsername": false,
"rememberMe": false,
"verifyEmail": false,
Expand Down Expand Up @@ -459,6 +459,9 @@ data:
"requiredCredentials": [
"password"
],
"defaultGroups": [
"/Users"
],
"otpPolicyType": "totp",
"otpPolicyAlgorithm": "HmacSHA1",
"otpPolicyInitialCounter": 0,
Expand Down Expand Up @@ -2305,6 +2308,14 @@ data:
"priority": 60,
"userSetupAllowed": false,
"autheticatorFlow": false
},
{
"authenticator": "registration-terms-and-conditions",
"authenticatorFlow": false,
"requirement": "DISABLED",
"priority": 70,
"autheticatorFlow": false,
"userSetupAllowed": false
}
]
},
Expand Down Expand Up @@ -2396,9 +2407,9 @@ data:
"config": {}
},
{
"alias": "terms_and_conditions",
"alias": "TERMS_AND_CONDITIONS",
"name": "Terms and Conditions",
"providerId": "terms_and_conditions",
"providerId": "TERMS_AND_CONDITIONS",
"enabled": false,
"defaultAction": false,
"priority": 20,
Expand Down

0 comments on commit bef1c4d

Please sign in to comment.