Kerberos Connections to XMLA Endpoints
This section describes how to configure AtScale to use Kerberos for inbound authentication connecting to XMLA endpoints.
If you are configuring Kerberos XMLA, you do not need to complete the steps described in Configuring Kerberos. That procedure is for data warehouse Kerberos and is not needed for XMLA.
Introduction
Before configuring Kerberos connections to XMLA endpoints, be aware of the following:
- AtScale supports Kerberos login on HTTP endpoint with SPNEGO token.
- Only client and server tickets issued by Microsoft KDC are supported.
- Tickets issued by MIT KDC are not yet supported, thus multi-forest setup with a trust enabled between Microsoft AD and MIT KDC will not work.
- For a clustered setup, the SPN needs to match on the load balancer address.
- Configuring AtScale to use Kerberos for inbound authentication has only been verified to work when using Windows Authentication with Microsoft Excel, Power BI Service, and Power BI Desktop.
Prerequisites
Before you begin, ensure you have the following:
- Microsoft AD KDC
- Domain admin rights for
setspnandktpass sudoprivileges on every engine host- A directory (LDAP) connection to the same AD domain with User Kerberos Principal Attribute set
- Clocks for the AtScale host, the DC, and the client set to within 5 minutes of each other
Prepare Windows AD and KDC
First, you need to set up and configure several components in Active Directory (AD) and KDC.
If you are running AtScale in a clustered configuration, or use a load balancer, complete these steps on every engine host.
-
Add a DNS Entry.
If the host does not currently have a forward A record, add one for the new AtScale instance in DNS Manager. This can optionally be followed by a Reverse Lookup Zone and Entry.
NoteIf you are using a Reverse Lookup Zone, it should be created before the creation of the A record so that it automatically creates the record for the server.
-
Add a Service User in Active Directory. Windows requires a Service User to serve and act as an SPN (Service Principal Name).
When creating the Service User, configure it as follows:
- In the Account tab, check the Password never expires checkbox, and uncheck User must change password at next logon. A password change invalidates the keytab.
- AtScale strongly recommends checking the This account supports Kerberos AES 256 bit encryption checkbox to use stronger encryption keys for increased security.
NoteIf you are running AtScale in a clustered configuration, or use a load balancer, only use one SPN for the load balancer's FQDN.
-
Create the SPN:
-
In the Domain controller/KDC, start PowerShell with elevated rights.
-
Decide on a name for the SPN and verify that no other account already owns it by running:
setspn -F -Q HTTP/atscale01.corp.example.com@CORP.EXAMPLE.COMThe above command must return
No such SPN found.Note the following:
- The name must have the format
HTTP/atscale01.corp.example.com@CORP.EXAMPLE.COM. - Users must connect with the FQDN.
- For Stand-Alone AtScale, with no load balancer, the FQDN must match the host name of the AtScale instance. For Clustered AtScale, or AtScale that is using a Load Balancer, it must match the Load Balancer.
- The name must have the format
-
Create the SPN. For example:
setspn -s HTTP/atscale01.corp.example.com@CORP.EXAMPLE.COM
-
-
Create a keytab:
NoteIf you are running AtScale in a clustered configuration, or use a load balancer, only use one keytab, and copy it to every engine host. Do not run
ktpassfor each host, because each run invalidates the keytabs already copied.-
In the Domain controller/KDC, start PowerShell with elevated rights and run the following. Be sure to replace the Principal, mapuser, and Output parameters with your own values.
ktpass -princ 'HTTP/kerberos-sso-node-01.pbi.example.com@PBI.EXAMPLE.COM' -crypto {ENCRYPTION_MECHANISM(S)} -mapuser 'PBI\kerberossso01' -pass * -out /opt/atscale/conf/atscale-xmla.keytab -ptype KRB5_NT_PRINCIPALNote the following:
- The keytab is a credential and should be handled as such. Delete the copy on the AD server once it is installed on AtScale.
- Running
ktpassmore than once invalidates earlier keytabs. In a cluster, run it once and copy the same keytab to every host. - The keytab file must be owned by and readable only by the engine user.
- There will be a prompt for the password.
- AtScale supports and recommends AES256-SHA1 encryption, which is enabled explicitly for the account. RC4-HMAC-NT (legacy) and AES128-SHA1 are also supported.
- When generating the keytab, the domain name must be in capital letters.
- For more information, see ktpass in the Microsoft documentation.
-
Verify the contents of the keytab file. For example:
klist -ket /opt/atscale/conf/atscale-xmla.keytab
-
-
Configure the
/etc/krb5.conffile for AtScale. This file should have been created when the Kerberos client package was installed.Note the following:
- This step must be executed with
sudoprivileges or as therootuser. - The engine finds the KDC through
/etc/krb5.conf. DNS SRV is a fallback that often fails. - The engine reads
/etc/krb5.confonly when it starts. If you change the file after the engine is running, you must restart the engine. If you do not, XMLA logins will fail with an error ofCannot locate KDC.
To configure
/etc/krb5.conffor Atscale:-
Determine the DNS name of the Kerberos KDC and
admin_server. In a Windows Keberos Realm, these should have the same name. -
Make a backup copy of the current
/etc/krb5.conffile:$ sudo cp -p /etc/krb5.conf krb5.conf.backup -
In the
/etc/krb5.conffile, add realm and domain sections for AtScale.NoteAdd these sections to your existing
/etc/krb5.conf. Do not replace the file, as other services on the host may depend on it.[libdefaults]
default_realm = CORP.EXAMPLE.COM
[realms]
CORP.EXAMPLE.COM = {
kdc = dc01.corp.example.com
kdc = dc02.corp.example.com
admin_server = dc01.corp.example.com
}
[domain_realm]
.corp.example.com = CORP.EXAMPLE.COM
corp.example.com = CORP.EXAMPLE.COMWhere:
CORP.EXAMPLE.COMis your AD domain name in uppercase. This is the Kerberos realm and must be uppercase everywhere it appears.corp.example.comis your AD DNS domain in lowercase.dc01.corp.example.com/dc02.corp.example.comare the FQDNs of your domain controllers. Add onekdc =line per DC you want the engine to try. One line is enough.admin_serveris any one DC. AD runs the admin service on every DC.
NoteIf the AtScale host's DNS domain is different from the AD domain (for example the host is
atscale01.apps.example.comand AD iscorp.example.com), add a line for that domain under[domain_realm]. For example,.apps.example.com = CORP.EXAMPLE.COM.
- This step must be executed with
Configuring AtScale
After completing the steps above for AD and KDC, you should perform the following steps in AtScale:
-
Copy the keytab file to the AtScale host. It is recommended (but not required) to put it in
/opt/atscale/conf. -
Go to Settings > Organization Settings > Engine, and configure the following settings:
auth.xmla.kerberos.enabled: Enable this setting.auth.xmla.kerberos.keytab: Set to the location to the keytab file.auth.xmla.kerberos.spn: Set to the Service Principal Name. This must match the keytab principal exactly, including case.
-
Save your changes.
-
Restart the engine.
NoteIf you are running AtScale in a clustered configuration, or use a load balancer, restart the engine on every AtScale host.
Verification
To verify your configuration:
-
Obtain the XMLA MDX / DAX endpoint for AtScale.
-
Open Excel or Power BI Desktop, then open the Analysis Services connector. For Excel, select Use Windows Authentication.
-
If you have made changes to a working or broken config, on the client, clear cached tickets (especially after creating a new keytab), then close Excel/Power BI completely and reopen it. Run the following:
klist purge
klist get HTTP/atscale01.corp.example.comBe sure to replace
atscale01.corp.example.comwith your AtScale host. -
Enter the Server name in Excel or Power BI Desktop and attempt to connect to AtScale.
If everything is working properly, AtScale's engine.log file will contain a line similar to the following:
Authenticated for user KerberosAuthInfo(CORP)(jsmith)
Troubleshooting
You receive an error of "Cannot locate KDC"
The engine cannot find a KDC for the realm. /etc/krb5.conf has no [realms] entry for it, and DNS SRV lookup failed. This happens even when the three auth.xmla.kerberos.* settings are correct.
If this occurs, add the realm to /etc/krb5.conf, check port 88 to the DC, then restart the engine. Changes to krb5.conf require a restart.
You receive an error of "Pre-authentication information was invalid"
The Kerberos keytab file installed in AtScale and referenced by auth.xmla.kerberos.keytab may no longer be valid because the service account used to create the keytab file on the Windows Server, the Windows Kerberos KDC, may have had its password changed. The service account may also be locked or may have been removed.
If the password for the service account was changed, any keytab file created for the account will now be invalid and must be recreated.
If this occurs, use kinit to test connectivity to the KDC.
- If the output of the command is either
Pre-authentication information was invalidorClient not found in kerberos database, check with service account in the Windows KDC. - If the password was changed for the service account, a new keytab file will need to be generated and installed on AtScale.
Checksum fails / Specified version of key is not available
The client's ticket was made with a key or key version (KVNO) that is not in the installed keytab. Usually ktpass was run again and the new keytab was not installed, or not on every cluster host.
If this occurs, compare klist -ket with the vno ktpass printed. Install the latest keytab on every host, restart the engine, and run klist purge on the client.
Excel or Power BI prompts for a username and password, or engine.log shows no KerberosAuthInfo line for the connection
Windows did not get a ticket for the SPN and fell back to NTLM or Basic. Usually the URL host does not match the SPN host, the SPN is registered on two accounts, or the URL uses an IP address or a short name.
If this occurs, on the client, run klist get HTTP/atscale01.corp.example.com, where atscale01.corp.example.com is your AtScale host. On the DC, run setspn -F -Q HTTP/atscale01.corp.example.com. Connect with the exact FQDN in the SPN.
More information
In case you use Power Bi Service, after completing the steps above you can set up Power BI as described in Power BI Service SSO via Inbound Kerberos.