apps/docs/content/guides/integrate/service-accounts/personal-access-token.mdx
A Personal Access Token (PAT) is a ready-to-use token that can be used as an Authorization header. At the moment ZITADEL only allows PATs for service accounts.
It is an alternative to the private key JWT and client credentials. Read more about the different authentication methods for service accounts.
To be able to access the ZITADEL APIs, your service account needs permissions to ZITADEL.
You might want to access ZITADEL APIs to manage resources, such as users, or to validate tokens sent to your backend service. Follow our guides on how to access ZITADEL API to use the ZITADEL APIs with your service account.
Your API endpoint might receive tokens from users and need to validate the token with ZITADEL. In this case your API needs to authenticate with ZITADEL and then do token introspection. Follow our guide on token introspection with private key JWT to learn more.
Because the PAT is a ready-to-use token, you can add it as an Authorization Header and send it in your requests to the ZITADEL API. In this example we read the organization of the service account.
curl --request GET \
--url ${CUSTOM_DOMAIN}/management/v1/orgs/me \
--header 'Authorization: Bearer {PAT}'
The above steps demonstrate service account authentication. If your application also needs to authenticate itself, you can utilize Client Credentials Grant. Refer to ZITADEL documentation for details on this alternative method.
By following these steps and adhering to security best practices, you can effectively secure service account and client application communication within ZITADEL using private key JWT authentication.