Skip to content

AWS Cognito device_key purpose

0

Hi!

We are using AWS Cognito with device tracking set to "Always remember." We store the device_key in cookies. When a user tries to refresh their access token using the REFRESH_TOKEN_AUTH flow, we send the device_key in the request parameters.

My question is: If a user tries to use the same device_key on another computer, should Cognito return a 403 error, since the device_key is actually associated with a different machine?

.initiateAuth({
  AuthFlow: "REFRESH_TOKEN_AUTH",
  ClientId: clientId,
  AuthParameters: {
    REFRESH_TOKEN: refreshToken,
    DEVICE_KEY: deviceKey
  }
})

asked 2 years ago255 views

1 Answer
1
Accepted Answer

When using AWS Cognito with device tracking enabled and "Always remember," the device_key is tied to a specific device. If a user tries to use the same device_key on a different machine, Cognito doesn't necessarily return a 403 error, but the device may be flagged as new.

Cognito will typically prompt for reauthentication or confirmation, as the device_key is intended to uniquely identify the original device. Therefore, the key's purpose is to track device trustworthiness, and using it on another device will likely trigger additional security measures.

EXPERT

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.