Hello, Is there a way to check what custom claims ...
# ask-a-descoper
a
Hello, Is there a way to check what custom claims are present in access key
r
Yes, you can check the custom claims present in an access key by loading the access key details using the Management SDK. Here's how to load an access key and view its custom claims:
Copy code
const id = "xxxx"
 
const resp = await descopeClient.management.accessKey.load(id);
if (!resp.ok) {
  console.log("Failed to load access key.")
  console.log("Status Code: " + resp.code)
  console.log("Error Code: " + resp.error.errorCode)
  console.log("Error Description: " + resp.error.errorDescription)
  console.log("Error Message: " + resp.error.errorMessage)
}
else {
  console.log("Successfully loaded access key.")
  console.log(resp.data)
}
The loaded access key response will include the
customClaims
field, which contains any custom claims associated with that access key. Check doc: https://docs.descope.com/management/m2m-access-keys/sdks
a
Thank you,