Merge pull request #4905 from krzysztof-cislo/dev

Takes a long time to explain. OK, we'll merge as-is. We don't use this code, so it has no impact on us, anyway.
This commit is contained in:
David Benson 2025-03-03 10:48:01 +00:00 committed by GitHub
commit bc64f18f74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 23 additions and 18 deletions

View File

@ -10,6 +10,7 @@ abstract public class MSGraphAuth extends AbsAuth
{
public static String CLIENT_SECRET_FILE_PATH = "msgraph_client_secret";
public static String CLIENT_ID_FILE_PATH = "msgraph_client_id";
public static String TENANT_ID_FILE_PATH = "msgraph_tenant_id";
private static Config CONFIG = null;
@ -17,12 +18,16 @@ abstract public class MSGraphAuth extends AbsAuth
{
if (CONFIG == null)
{
String clientSerets = SecretFacade.getSecret(CLIENT_SECRET_FILE_PATH, getServletContext()),
clientIds = SecretFacade.getSecret(CLIENT_ID_FILE_PATH, getServletContext());
String clientSecrets = SecretFacade.getSecret(CLIENT_SECRET_FILE_PATH, getServletContext()),
clientId = SecretFacade.getSecret(CLIENT_ID_FILE_PATH, getServletContext()),
tenantId = SecretFacade.getSecret(TENANT_ID_FILE_PATH, getServletContext());
CONFIG = new Config(clientId, clientSecrets);
String tenantIdPathPart = (tenantId != null && !tenantId.isEmpty()) ? tenantId : "common";
CONFIG.AUTH_SERVICE_URL = "https://login.microsoftonline.com/" + tenantIdPathPart + "/oauth2/v2.0/token";
CONFIG = new Config(clientIds, clientSerets);
CONFIG.REDIRECT_PATH = "/microsoft";
CONFIG.AUTH_SERVICE_URL = "https://login.microsoftonline.com/common/oauth2/v2.0/token";
}
return CONFIG;