ADFS 2019: Allow logon with sAMAccountName
Active Directory Federation Services (ADFS) allows plenty of customizations when it comes to the website theme.
One specific customization allows the logon using just the sAMAccountName (e.g.
awesome-admin) instead of the UPN (User Principal Name) (e.g.
I’ve modified the code to work for the latest ADFS2019 theme.
Follow following steps to implement this:
Clone the default template: (only needed to be done once)
New-AdfsWebTheme –Name custom –SourceName DefaultAdfs2019
Export the new custom theme:
Export-AdfsWebTheme –Name custom –DirectoryPath c:\theme
onload.jsin any editor of your choice (notepad does the job as well)
APPEND the content from
onload.add.jsfrom below GitHub repository to
onload.jsAT THE END:
Save the modified
Set-AdfsWebTheme -TargetName custom -OnLoadScriptPath "c:\theme\script\onload.js"
Change the current default template: (only needed to be done once)
Set-AdfsWebConfig -ActiveThemeName custom
Hope this helps someone!
- 2022-07-24: Based on Martins feedback from the comments I have added support for "Update Password" page. Also the entire code base was reworked and code moved to GitHub.