CognitoIdentityProvider / Client / admin_list_user_auth_events
admin_list_user_auth_events#
- CognitoIdentityProvider.Client.admin_list_user_auth_events(**kwargs)#
A history of user activity and any risks detected as part of Amazon Cognito advanced security.
Note
Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.
Learn more
See also: AWS API Documentation
Request Syntax
response = client.admin_list_user_auth_events( UserPoolId='string', Username='string', MaxResults=123, NextToken='string' )
- Parameters:
UserPoolId (string) –
[REQUIRED]
The user pool ID.
Username (string) –
[REQUIRED]
The username of the user that you want to query or modify. The value of this parameter is typically your user’s username, but it can be any of their alias attributes. If
username
isn’t an alias attribute in your user pool, this value must be thesub
of a local user or the username of a user from a third-party IdP.MaxResults (integer) – The maximum number of authentication events to return. Returns 60 events if you set
MaxResults
to 0, or if you don’t include aMaxResults
parameter.NextToken (string) – A pagination token.
- Return type:
dict
- Returns:
Response Syntax
{ 'AuthEvents': [ { 'EventId': 'string', 'EventType': 'SignIn'|'SignUp'|'ForgotPassword'|'PasswordChange'|'ResendCode', 'CreationDate': datetime(2015, 1, 1), 'EventResponse': 'Pass'|'Fail'|'InProgress', 'EventRisk': { 'RiskDecision': 'NoRisk'|'AccountTakeover'|'Block', 'RiskLevel': 'Low'|'Medium'|'High', 'CompromisedCredentialsDetected': True|False }, 'ChallengeResponses': [ { 'ChallengeName': 'Password'|'Mfa', 'ChallengeResponse': 'Success'|'Failure' }, ], 'EventContextData': { 'IpAddress': 'string', 'DeviceName': 'string', 'Timezone': 'string', 'City': 'string', 'Country': 'string' }, 'EventFeedback': { 'FeedbackValue': 'Valid'|'Invalid', 'Provider': 'string', 'FeedbackDate': datetime(2015, 1, 1) } }, ], 'NextToken': 'string' }
Response Structure
(dict) –
AuthEvents (list) –
The response object. It includes the
EventID
,EventType
,CreationDate
,EventRisk
, andEventResponse
.(dict) –
The authentication event type.
EventId (string) –
The event ID.
EventType (string) –
The event type.
CreationDate (datetime) –
The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java
Date
object.EventResponse (string) –
The event response.
EventRisk (dict) –
The event risk.
RiskDecision (string) –
The risk decision.
RiskLevel (string) –
The risk level.
CompromisedCredentialsDetected (boolean) –
Indicates whether compromised credentials were detected during an authentication event.
ChallengeResponses (list) –
The challenge responses.
(dict) –
The challenge response type.
ChallengeName (string) –
The challenge name.
ChallengeResponse (string) –
The challenge response.
EventContextData (dict) –
The user context data captured at the time of an event request. This value provides additional information about the client from which event the request is received.
IpAddress (string) –
The source IP address of your user’s device.
DeviceName (string) –
The user’s device name.
Timezone (string) –
The user’s time zone.
City (string) –
The user’s city.
Country (string) –
The user’s country.
EventFeedback (dict) –
A flag specifying the user feedback captured at the time of an event request is good or bad.
FeedbackValue (string) –
The authentication event feedback value. When you provide a
FeedbackValue
value ofvalid
, you tell Amazon Cognito that you trust a user session where Amazon Cognito has evaluated some level of risk. When you provide aFeedbackValue
value ofinvalid
, you tell Amazon Cognito that you don’t trust a user session, or you don’t believe that Amazon Cognito evaluated a high-enough risk level.Provider (string) –
The provider.
FeedbackDate (datetime) –
The event feedback date.
NextToken (string) –
A pagination token.
Exceptions
CognitoIdentityProvider.Client.exceptions.InvalidParameterException
CognitoIdentityProvider.Client.exceptions.ResourceNotFoundException
CognitoIdentityProvider.Client.exceptions.TooManyRequestsException
CognitoIdentityProvider.Client.exceptions.NotAuthorizedException
CognitoIdentityProvider.Client.exceptions.UserNotFoundException
CognitoIdentityProvider.Client.exceptions.UserPoolAddOnNotEnabledException
CognitoIdentityProvider.Client.exceptions.InternalErrorException