end-users:act-as permission.
This page calls it the act-as key. Keep the act-as key on your backend.
Do not send it to your users.
Your backend can use the act-as key in two ways:
To set up your backend and create rigs for your users, see
End-user access.
Act as an end-user with the Amika-As-Principal header
Your backend sends two things on each HTTP API request:
- The act-as key, in the
Authorizationheader. - The header
Amika-As-Principal: end_user:<your user id>.
actAs returns a new client. The new client acts as the
end-user:
- Without the
Amika-As-Principalheader, the act-as key gets403on all routes except three: mint a token, revoke a token, and disable an end-user. - The act-as key cannot act as your organization.
- After you disable an end-user, a request that acts as them gets
403.
Give the end-user a principal token
Your backend mints a principal token for one end-user. The end-user’s machine and laptop send this token to Amika. The act-as key stays on your backend. In the SDK:- A principal token acts as one end-user. It cannot mint a token.
- A principal token expires after its TTL. The maximum TTL is 24 hours. Mint
a new token before the old one expires. In an app,
refreshingTokenSourcein the SDK does this for you. - When you disable an end-user, all of their tokens stop working at once.