Hi Team, The documentation mentions: “Before imper...
# ask-a-descoper
m
Hi Team, The documentation mentions: “Before impersonation, users can grant consent to be impersonated via a User Impersonation Consent Flow.” Is it possible to grant this consent directly through the SDK or API instead of using the flow? If yes, could you please confirm the field or attribute name for setting the Consent Expiration value?
👍 1
r
Hey @Mohammadkaif currently the ability to set the impersonation consent expiry is missing from the API, please file a feature request so we can add this to our backlog
m
@Reuven Zabirov Can we at least fetch the consent expiration field in the users if set from the flow?
r
you don't need to actually fetch it to block the impersonation, if it's expired, it will fail via flow (see screenshot) or when passing the
validate_consent
to the SDK python example:
Copy code
response = descope_client.mgmt.jwt.impersonate(impersonator_id='impersonate@admin.com', login_id='impersonate@user.com', validate_consent=True)
m
@Reuven Zabirov Yes, that is already in place, but i want to show the expiration date on my UI to the user. For that i need to fetch this Consent Expiration field value.
r
do you want to show it before or after the impersonator tries to impersonate?
m
If the user is logged in and has already granted impersonation consent, we only need to display the consent expiration duration indicating how long others will be able to impersonate this user.
r
would you rather this information will be accessible via API? so you can display it without a Descope Flow?
m
i want to fetch it via API only. But in current get users api, it is not included. Is it?
r
yeah, you are right - it's not. I am opening an internal request to add this. I will keep you posted
cc @Prashasth Baliga
m
Okhay, thanks
@Reuven Zabirov Hi, is there any way i can provide custom hours/days in this flow?