PATs are long-lived tokens that can be created through the pyck administration interface.
Example Authentication Flow
1. Obtain a JWT Token
Authenticate with ZITADEL to obtain a JWT token. This typically involves redirecting the user to the ZITADEL login page and handling the callback with the token.
2. Make Authenticated Requests
Once you have a token, include it in your GraphQL requests:
3. Handle Token Expiration
JWT tokens expire after a certain period. When a token expires, you'll receive a 401 Unauthorized response. You should:
Detect the 401 response
Request a new token using the refresh token flow
Retry the original request with the new token
Testing Authentication
You can test your authentication by querying the me endpoint, which returns information about the authenticated user:
If authentication is successful, you'll receive information about your user. If not, you'll receive an error message.