HI
Jérôme,
I happy to post the configuration if required, but I think you have a slight error in CAS causing the tenant id to get lost.
In "BaseDelegatedClientFactory.java" you have the "getOidcClientFrom" method which has the following for azure
if (clientProperties.getAzure().isEnabled() && StringUtils.isNotBlank(clientProperties.getAzure().getId())) {
LOGGER.debug("Building OpenID Connect client for Azure AD...");
val azure = getOidcConfigurationForClient(clientProperties.getAzure(), AzureAd2OidcConfiguration.class);
azure.setTenant(clientProperties.getAzure().getTenant());
val cfg = new AzureAd2OidcConfiguration(azure);
val azureClient = new AzureAd2Client(cfg);
configureClient(azureClient, clientProperties.getAzure(), casProperties);
return azureClient;
}
Highlighted in bold is what I think the issue is as when I inspected the "AzureAd2OidcConfiguration" the constructor does set the tenant and this is causing the tenant to get lost.
I have some custom changes to set the login_hint for azure when using the dynamic lookup. I added extra code to test if changing it to below worked and it proceed to microsoft but I got another error after it came back. I will post that error in another message.
if (clientProperties.getAzure().isEnabled() && StringUtils.isNotBlank(clientProperties.getAzure().getId())) {
LOGGER.debug("Building OpenID Connect client for Azure AD...");
val cfg= getOidcConfigurationForClient(clientProperties.getAzure(), AzureAd2OidcConfiguration.class);
cfg.setTenant(clientProperties.getAzure().getTenant());
val azureClient = new AzureAd2Client(cfg);
configureClient(azureClient, clientProperties.getAzure(), casProperties);
return azureClient;
}
Thanks.
Regards,
Colin