describeSObjects(), query(), retrieve()
With one exception, only users with Manage Users permissions can access this object. The exception is that, in API version 37.0 and later, all users can retrieve their own login history records.
Field | Details |
---|---|
ApiType |
|
APIVersion |
|
Application |
|
AuthenticationServiceId |
|
Browser |
|
ClientVersion |
|
CipherSuite |
|
CountryIso |
|
LoginGeoId |
|
LoginTime |
|
LoginType | |
LoginUrl |
|
NetworkId |
|
Platform |
|
SourceIp |
|
Status |
|
TlsProtocol | |
UserId |
|
Not all fields are filterable. You can only filter on the following fields:
The API allows you to do many powerful queries. A few examples are:
Sample Query | Query String |
---|---|
Simple query showing UserId & LoginTime for each user | SELECT UserId, LoginTime from LoginHistory; |
Query showing logins only after a specified date and time | SELECT UserId, LoginTime from LoginHistory WHERE LoginTime > 2010-09-20T22:16:30.000Z; |
Query showing logins for a specific time interval | SELECT UserId, LoginTime from LoginHistory WHERE LoginTime > 2010-09-20T22:16:30.000Z AND LoginTime < 2010-09-21T22:16:30.000Z; |
Query showing the authentication service for a SAML login event, where Id=AuthenticationServiceId from LoginHistory | SELECT name, issuer, samlVersion FROM SamlSsoConfig WHERE Id = '0LE###############' |
Query showing the authentication service for an authentication provider login event, where Id=AuthenticationServiceId from LoginHistory | SELECT Type, DeveloperName FROM AuthProvider WHERE Id = '0SO###############' |