KB N°09: Use a .fr e-mail address on the ADFS portal

Published November 23, 2023Modified on November 29, 2023

This article is a step-by-step guide to using a .fr or .com e-mail address on the ADFS connection portal (IDP) for Olfeo SaaS authentication.

Context

If your users' UPN, or simply your Active Directory domain, is .local, the ADFS web login portal that appears on first navigation will require your users to log in with a .local address (e.g. alfred.dupont@monentreprise.local).

In most cases, you want the user to be able to log in with an e-mail account: alfred.dupont@monentreprise.fr.

Steps

  • The first step is to create a custom Web theme. A quick way to do this is to export the default Web theme, then use the original code as the basis for your customizations. Run the following command applet to create a custom web theme by duplicating the default web theme:
New-AdfsWebTheme –Name custom –SourceName default
  • The next step is to export your custom Web theme so that you have an onload.js file that you can update. Run the following command applet to export your custom Web theme and generate an onload.js file:
Export-AdfsWebTheme –Name default –DirectoryPath c:\theme
  • You can then add this piece of JavaScript code to the c:\theme\script\onload.js file:
if (typeof Login != 'undefined'){
Login.submitLoginRequest = function () {
var u = new InputUtil();
var e = new LoginErrors();
var userName = document.getElementById(Login.userNameInput);
var password = document.getElementById(Login.passwordInput);

var userNameValue = userName.value.split('.')[0]+".local";
document.forms['loginForm'].UserName.value = userNameValue;

if (!password.value) {
u.setError(password, e.passwordEmpty);
return false;
}

document.forms['loginForm'].submit();
return false;
}
}
Set-AdfsWebTheme -TargetName custom -OnLoadScriptPath "c:\theme\script\onload.js"

The final step is to apply your customizations to the AD FS login pages. Run the following command applet to update AD FS with your customizations:

Set-AdfsWebConfig -ActiveThemeName custom

You can then connect to the ADFS IdP with the albert.dupont@montentreprise.fr login.