AD FS: How to Resolve the "No style sheet is configured" Error?

Protect Yourself Before Making Changes (Backup)

When performing changes on a live production system, it’s always good to have a “Plan B.” If you wish to back up the current state of your theme before making changes, run the following command:

PowerShell

# Export the theme to C:\ThemeBackup
Export-AdfsWebTheme -Name "ActiveADFS_Theme" -DirectoryPath "C:\ThemeBackup"

This command copies your theme’s CSS, logos, images and scripts into the folder you specified. If anything goes wrong, you can restore the theme from this backup.

This error occurs when a Custom Theme is used on AD FS, and a style sheet (CSS) corresponding to the user's browser language (Locale) is not defined.

The system defines and manages the state in 3 stages:

Diagnosis, When users attempt to log in with browsers having locale codes such as [tr-TR/1055], if the system cannot find a CSS assigned for this language, it returns the following error: “No style sheet is configured in the active theme for default locale...”. In this case, the login screen does not load.

Remediation, To resolve the error, you must introduce the missing language code (Locale) to the existing CSS file in the system via PowerShell.

The command template is as follows:

#PowerShell(administrator mode)
Set-AdfsWebTheme -TargetName "YourThemeName" -StyleSheet @{Locale=1055; Path="C:\FilePath\style.css"}

Locale Mapping, To determine what to write in the Locale section of the command, you should look directly at the error message you received.

  • LCID Usage (Recommended): The number 1055 in the expression [tr-TR/1055] seen in the error message is the identification number (LCID) of the missing language.

  • Application: It is sufficient to write this number seen in the error message into the Locale= part of the command. (For example, if the error is [en-US/1033], then Locale=1033 should be written).

Note: This process is "Additive". If you receive errors from different languages at different times (e.g., 1031, 1036), you can run the command again by only changing the Locale number. This process does not disrupt other languages; it only adds the new language to the list.

Last updated