Querying LoginHistory (APIVersion, ClientVersion fields) results in Internal Server Error due to failed Mutual Authentication Logins
Authentication , Spring 16 , Summer 16
Last updated 2022-02-10 ·Reference W-3165173 ·Reported By 1 users
Summary
Querying APIVersion and ClientVersion fields of LoginHistory Object results in an internal server error for entries made during a failed Mutual Authentication Logins.
Configure Your API Client to Use Mutual Authentication: https://help.salesforce.com/HTViewHelpDoc?id=security_keys_uploading_mutual_auth_cert_api.htm&language=en_US
When a user tries to login without using port 8443, this results in null entries for APIVersion and ClientVersion fields. Retrieving field values will cause an internal error on execution.
Repro
1) Contact Salesforce Support to Enable Mutual Authentication for your organization
2) Assign "Enforce SSL/TLS Mutual Authentication" permission to API Only User
3) Attempt to make a login call without using port 8443
4) Execute the following line of code in Execute Anonymous Window of Developer Console
List<LoginHistory> loginList = [SELECT Id, ClientVersion, APIVersion FROM LoginHistory];
Result:
---------
UNKNOWN ERROR: UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support
Workaround
Exclude APIVersion, ClientVersion fields from LoginHistory Query calls
Reported By (1)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.