From 2fad0afc73b6164a1f3e7160958f7698490b8a18 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 29 Dec 2023 05:34:00 +0100 Subject: [PATCH] IDEMPIERE-5354 - Correct name of SysConfig keys (max 50 chars) (#2164) - rename SysConfig OAUTH2_USE_ID_TOKEN_PREFERRED_USERNAME_ON_MICROSOFT_PROVIDER to OAUTH2_USE_ID_TOKEN_PREF_USERNAME_ON_MS_PROVIDER --- .../src/org/compiere/model/MAuthorizationCredential.java | 4 ++-- org.adempiere.base/src/org/compiere/model/MSysConfig.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MAuthorizationCredential.java b/org.adempiere.base/src/org/compiere/model/MAuthorizationCredential.java index cd44f071c0..1489615145 100644 --- a/org.adempiere.base/src/org/compiere/model/MAuthorizationCredential.java +++ b/org.adempiere.base/src/org/compiere/model/MAuthorizationCredential.java @@ -165,7 +165,7 @@ public class MAuthorizationCredential extends X_AD_AuthorizationCredential { String preferred_username = null; if ( ap.getAD_AuthorizationProvider_ID() == OAUTH2_AUTHORIZATION_PROVIDER_MICROSOFT - && MSysConfig.getBooleanValue("OAUTH2_USE_ID_TOKEN_PREFERRED_USERNAME_ON_MICROSOFT_PROVIDER", true)) { + && MSysConfig.getBooleanValue(MSysConfig.OAUTH2_USE_ID_TOKEN_PREF_USERNAME_ON_MS_PROVIDER, true)) { /* Microsoft send the user email information in the id_token in preferred_username field in some cases */ if (id_token != null && id_token instanceof String) { IdToken idtoken = IdToken.parse(tokenResponse.getFactory(), (String) tokenResponse.get("id_token")); @@ -174,7 +174,7 @@ public class MAuthorizationCredential extends X_AD_AuthorizationCredential { } if ( preferred_username == null && ap.getAD_AuthorizationProvider_ID() == OAUTH2_AUTHORIZATION_PROVIDER_MICROSOFT - && MSysConfig.getBooleanValue("OAUTH2_USE_ACCESS_TOKEN_UPN_ON_MICROSOFT_PROVIDER", true)) { + && MSysConfig.getBooleanValue(MSysConfig.OAUTH2_USE_ACCESS_TOKEN_UPN_ON_MICROSOFT_PROVIDER, true)) { /* Microsoft send the user email information in the access_token in upn field in some cases */ Object access_token = tokenResponse.get("access_token"); if (access_token != null && access_token instanceof String) { diff --git a/org.adempiere.base/src/org/compiere/model/MSysConfig.java b/org.adempiere.base/src/org/compiere/model/MSysConfig.java index 37ab5dad2b..9b1e52bfe0 100644 --- a/org.adempiere.base/src/org/compiere/model/MSysConfig.java +++ b/org.adempiere.base/src/org/compiere/model/MSysConfig.java @@ -44,7 +44,7 @@ public class MSysConfig extends X_AD_SysConfig /** * */ - private static final long serialVersionUID = 1548573102245466450L; + private static final long serialVersionUID = 7338447655641380126L; /** Constant for Predefine System Configuration Names (in alphabetical order) */ @@ -157,6 +157,8 @@ public class MSysConfig extends X_AD_SysConfig public static final String MONITOR_MAX_WAIT_FOR_CLUSTER_IN_SECONDS = "MONITOR_MAX_WAIT_FOR_CLUSTER_IN_SECONDS"; public static final String MROLE_GETDEFAULT_RETURNS_NULL_WHEN_NO_CONTEXT = "MROLE_GETDEFAULT_RETURNS_NULL_WHEN_NO_CONTEXT"; public static final String MSEQUENCE_GETNEXT_TIMEOUT = "MSEQUENCE_GETNEXT_TIMEOUT"; + public static final String OAUTH2_USE_ACCESS_TOKEN_UPN_ON_MICROSOFT_PROVIDER = "OAUTH2_USE_ACCESS_TOKEN_UPN_ON_MICROSOFT_PROVIDER"; + public static final String OAUTH2_USE_ID_TOKEN_PREF_USERNAME_ON_MS_PROVIDER = "OAUTH2_USE_ID_TOKEN_PREF_USERNAME_ON_MS_PROVIDER"; public static final String ORDER_COLUMNS_TO_COPY_TO_NOT_COMPLETED_INVOICES = "ORDER_COLUMNS_TO_COPY_TO_NOT_COMPLETED_INVOICES"; public static final String PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CHECK_ON_PAYMENT = "PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CHECK_ON_PAYMENT"; public static final String PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CHECK_ON_RECEIPT = "PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CHECK_ON_RECEIPT";