Update app/proprietary/src/main/java/stirling/software/proprietary/security/service/CustomUserDetailsService.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Anthony Stirling 2025-09-05 19:15:37 +01:00 committed by GitHub
parent 25013d7ccb
commit 15be7ce90f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,8 +75,8 @@ public class CustomUserDetailsService implements UserDetailsService {
*/ */
private AuthenticationType determinePreferredSSOType() { private AuthenticationType determinePreferredSSOType() {
// Check what SSO types are enabled and prefer in order: OAUTH2 > SAML2 > fallback to OAUTH2 // Check what SSO types are enabled and prefer in order: OAUTH2 > SAML2 > fallback to OAUTH2
boolean oauth2Enabled = securityProperties.getOauth2().getEnabled(); boolean oauth2Enabled = securityProperties.getOauth2() != null && securityProperties.getOauth2().getEnabled();
boolean saml2Enabled = securityProperties.getSaml2().getEnabled(); boolean saml2Enabled = securityProperties.getSaml2() != null && securityProperties.getSaml2().getEnabled();
if (oauth2Enabled) { if (oauth2Enabled) {
return AuthenticationType.OAUTH2; return AuthenticationType.OAUTH2;