Hey <@U04UQ68083H> why would i need to Convert Ory...
# ory-copilot
h
Hey @chilly-king-10285 why would i need to Convert Ory Sessions to JSON Web Tokens
b
A message from kapa.ai
You might want to convert Ory Sessions to JSON Web Tokens (JWTs) in scenarios where using the default Ory session cookie or session token is difficult or not possible. Some common reasons include: - Cross-Origin (CORS) Requests: When making requests across different origins, including cookies or session tokens can be problematic due to browser restrictions. JWTs can be sent in headers and are more flexible for these cases. - Representing a Signed-In User: JWTs are a standard way to represent authenticated users, making it easier to integrate with systems that expect JWTs. - Third-Party Integrations: Some services (like Zendesk SSO) require JWTs for authentication or single sign-on. - Reducing API Calls: JWTs are self-contained and can reduce the need to repeatedly call Ory APIs to validate sessions, as the JWT itself can be verified locally. Ory provides a mechanism to convert sessions to JWTs to address these needs, allowing you to customize claims and signing keys as required for your use case. This approach is especially useful when you need a portable, verifiable token that can be used outside the Ory ecosystem or in distributed architectures [Convert Ory Sessions to JSON Web Tokens](https://www.ory.sh/docs/identities/session-to-jwt-cors).