This article explains how to work around the 20 characters limit in the windows account name in ADFS when using SAML.
This article assumes you have already set up ADFS correctly with Qlik Sense.
Resolution:
In order to work around this issue, you will need to create a custom claim description.
Windows account name is limited to 20 characters length. UPN holds the full user name but also the domain name (Example: xbxpoufaloiacsvignhv.ekevezajzktyfzccvhzl@domain.local).
So, the simplest is to create a custom claim and extract the string before @ from the UPN claim description.
In ADFS, in claim descriptions, choose "Add Claim Description"
![User-added image](https://qlik.my.salesforce.com/servlet/servlet.ImageServer?id=015D0000003s8jI&oid=00D20000000IGPX&lastMod=1491468423000)
Create a new claim with a name and claim type of your choice. Claim type must have the below format.
![User-added image](https://qlik.my.salesforce.com/servlet/servlet.ImageServer?id=015D0000005XNIc&oid=00D20000000IGPX&lastMod=1547821165000)
In Relying Party Trusts, choose the Reying party trust created for Qlik Sense and in the right pane, choose "Edit Claim Rules"
![User-added image](https://qlik.my.salesforce.com/servlet/servlet.ImageServer?id=015D0000003s8jS&oid=00D20000000IGPX&lastMod=1491468493000)
In the existing claim rule, create a second rule based on template "Send Claims Using a Custom Rule" with the following rule:
c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn", Value =~ "^.*(@).*$"]
=> issue(Type = "http://temp.org/20charname", Value = RegexReplace(c.Value, "@.*", ""));
![User-added image](https://qlik.my.salesforce.com/servlet/servlet.ImageServer?id=015D0000005XNIh&oid=00D20000000IGPX&lastMod=1547821189000)
On the Qlik Sense side, in virtual proxy settings, including the newly created claim description as the SAML attribute for user ID
![User-added image](https://qlik.my.salesforce.com/servlet/servlet.ImageServer?id=015D0000005XNIm&oid=00D20000000IGPX&lastMod=1547821198000)
You should now be able to log in to the hub, the user name will be registered correctly in Qlik Sense even if it is more than 20 characters long.