Get signIn
Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Retrieve a specific Microsoft Entra user sign-in event for your tenant. Sign-ins that are interactive in nature (where a username/password is passed as part of auth token) and successful federated sign-ins are currently included in the sign-in logs.
Note
This article describes how to export personal data from a device or service. These steps can be used to support your obligations under the General Data Protection Regulation (GDPR). Authorized tenant admins can use Microsoft Graph to correct, update, or delete identifiable information about end users, including customer and employee user profiles or personal data, such as a user's name, work title, address, or phone number, in your Microsoft Entra ID environment.
This API is available in the following national cloud deployments.
Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
---|---|---|---|
✅ | ✅ | ✅ | ✅ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | AuditLog.Read.All and Directory.Read.All | Not available. |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | AuditLog.Read.All and Directory.Read.All | Not available. |
Important
In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. The following least privileged roles are supported for this operation:
- Global Reader
- Reports Reader
- Security Administrator
- Security Operator
- Security Reader
The applied Conditional Access (CA) policies listed in appliedConditionalAccessPolicies property are only available to users and apps with roles that allow them to read conditional access data. If a user or app has permissions to read sign-in logs but not permission to read conditional access data, the appliedConditionalAccessPolicies property in the response will be omitted. The signed-in user must be assigned supported Microsoft Entra roles and the app granted supported Microsoft Graph permissions.
- The following least-privileged roles grant users permissions to view conditional access data:
- Global Reader
- Security Administrator
- Security Reader
- Conditional Access Administrator
- Applications must have at least one of the following permissions to see appliedConditionalAccessPolicy objects in the sign-in logs:
- Policy.Read.All
- Policy.Read.ConditionalAccess
- Policy.ReadWrite.ConditionalAccess
Signed-in users with any permissions can read their own sign-in logs. This feature helps users spot unexpected activity in their accounts. However, the users can't read CA data from their own logs unless they have one of the supporting permissions identified above.
HTTP request
GET /auditLogs/signIns/{id}
Optional query parameters
This method supports OData query parameters to help customize the response. For details about how to use these parameters, see OData query parameters.
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and a signIn object in the response body.
Example
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/auditLogs/signIns/66ea54eb-blah-4ee5-be62-ff5a759b0100
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"id":"66ea54eb-blah-4ee5-be62-ff5a759b0100",
"createdDateTime":"2021-06-30T16:34:32Z",
"userDisplayName":"Test contoso",
"userPrincipalName":"testaccount1@contoso.com",
"userId":"26be570a-1111-5555-b4e2-a37c6808512d",
"appId":"c44b4083-3bb0-49c1-b47d-974e53cbdf3c",
"appDisplayName":"Azure Portal",
"authenticationContextClassReferences": [
{
"id":"C1",
"details":"required"
}
],
"authenticationProtocol": "oAuth2",
"incomingTokenType": "Primary Refresh Token",
"ipAddress":"131.107.159.37",
"clientAppUsed":"Browser",
"clientCredentialType": "certificate",
"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36 Edg/91.0.864.54",
"correlationId":"5d295068-919b-4017-85d8-44be2f5f5483",
"conditionalAccessStatus":"notApplied",
"originalRequestId":"7dccb0d7-1041-4d82-b785-d865272e1400",
"homeTenantId": "4f7a7bc2-28e2-46a3-b90e-5ade5bc90138",
"homeTenantName": "",
"isTenantRestricted": false,
"isInteractive":true,
"tokenIssuerName":"",
"tokenIssuerType":"AzureAD",
"processingTimeInMilliseconds":761,
"riskDetail":"none",
"riskLevelAggregated":"none",
"riskLevelDuringSignIn":"none",
"riskState":"none",
"riskEventTypes_v2":[],
"resourceDisplayName":"Windows Azure Service Management API",
"resourceId":"797f4846-ba00-4fd7-ba43-dac1f8f63013",
"resourceServicePrincipalId": "a6033f22-27f9-45cb-8f63-7dd8a0590e4e",
"uniqueTokenIdentifier": "ZTE0OTk3YTQtZjg5Mi00YjBiLWIwNTEtZmViZTA1YzJhNDli",
"resourceTenantId":"99081087-73c4-48d1-a112-f60ff75114f7",
"homeTenantId":"99081087-73c4-48d1-a112-f60ff75114f7",
"authenticationAppDeviceDetails": null,
"authenticationAppPolicyDetails": null,
"authenticationMethodsUsed":[],
"authenticationRequirement":"singleFactorAuthentication",
"azureResourceId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testVM",
"federatedCredentialId": "729ab02a-edd5-4ef5-a285-2d91a3c772ab",
"signInIdentifier":"testaccount1@contoso.com",
"signInEventTypes":["interactiveUser"],
"servicePrincipalId":"",
"sessionLifetimePolicies": [
{
"expirationRequirement": "tenantTokenLifetimePolicy",
"detail": "The user was required to sign in again according to the tenant session lifetime policy"
}
],
"userType":"member",
"flaggedForReview":false,
"isTenantRestricted":false,
"autonomousSystemNumber":3598,
"crossTenantAccessType":"none",
"status":{
"errorCode":50126,
"failureReason":"Error validating credentials due to invalid username or password.",
"additionalDetails":"The user didn't enter the right credentials. \u00a0It's expected to see some number of these errors in your logs due to users making mistakes."
},
"deviceDetail":{
"deviceId":"",
"displayName":"",
"operatingSystem":"Windows 10",
"browser":"Edge 91.0.864",
"isCompliant":false,
"isManaged":false,
"trustType":""
},
"location":{
"city":"Redmond",
"state":"Washington",
"countryOrRegion":"US",
"geoCoordinates":{
"altitude":null,
"latitude":47.6807,
"longitude":-122.1231
}
},
"appliedConditionalAccessPolicies":[],
"authenticationProcessingDetails":[
{
"key":"Login Hint Present",
"value":"True"
}
],
"networkLocationDetails":[
{
"networkType":"namedNetwork",
"networkNames":["North America"]
}
],
"managedServiceIdentity":{
"msiType":"systemAssigned",
"associatedResourceId":"/subscriptions/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/resourcegroups/Scenario-TestRPToKeyVaultSAJob_USCentral/providers/Providers.Test/msiStateful/testrp30964",
"federatedTokenId" : "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"federatedTokenIssuer" : "https://aks_test.prod-aks.azure.com/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/"
},
"authenticationDetails":[
{
"authenticationStepDateTime":"2021-06-30T16:34:32Z",
"authenticationMethod":"Password",
"authenticationMethodDetail":"Password in the cloud",
"succeeded":false,
"authenticationStepResultDetail":"Invalid username or password or Invalid on-premise username or password.",
"authenticationStepRequirement":"Primary authentication"
}
],
"authenticationRequirementPolicies":[],
"sessionLifetimePolicies":[]
}