bland-finland-95044
09/17/2025, 3:08 PMchilly-king-10285
09/17/2025, 3:08 PMchilly-king-10285
09/17/2025, 3:08 PMcat new-claims-mapper.jsonnet | base64
2. Patch your identity config to update only the claims_mapper_url for your tokenizer template. For example, if your template is called jwt_example_template1: ory patch identity-config --project <project-id> --workspace <workspace-id> \ --replace '/session/whoami/tokenizer/templates/jwt_example_template1/claims_mapper_url="base64://<YOUR_NEW_BASE64_ENCODED_JSONNET>"' \ --format yaml
This command updates just the claims mapper for the specified JWT template, leaving the jwks_url (and thus your JWK) untouched. You do not need to re-upload or modify the JWK if it remains valid and unchanged. For more details on JWT tokenizer templates and claims mappers, see the official documentation: [Convert Ory Sessions to JSON Web Tokens](https://www.ory.sh/docs/identities/session-to-jwt-cors#json-web-token-templates).bland-finland-95044
09/17/2025, 3:14 PMchilly-king-10285
09/17/2025, 3:14 PMchilly-king-10285
09/17/2025, 3:14 PMbash ory update identity-config --project <project-id> --workspace <workspace-id> --file identity-config.yaml
This will make the sub claim in JWTs default back to the Ory Session's IdentityID, as described in the documentation: > The sub claim can't be customized and is always set to the Ory Session's IdentityID. [Convert Ory Sessions to JSON Web Tokens](https://www.ory.sh/docs/identities/session-to-jwt-cors#json-web-token-templates) For more on the external_id and subject_source options, see: [External Identifiers](https://www.ory.sh/docs/kratos/manage-identities/external-id)bland-finland-95044
09/17/2025, 3:18 PMchilly-king-10285
09/17/2025, 3:18 PMchilly-king-10285
09/17/2025, 3:18 PMbash ory patch identity-config --project <project-id> --workspace <workspace-id> \ --remove '/session/whoami/tokenizer/templates/jwt_template_1/subject_source'
This command specifically removes the subject_source field from the jwt_template_1 template, restoring the default behavior for the sub claim in your JWTs [External Identifiers](https://www.ory.sh/docs/kratos/manage-identities/external-id) [Convert Ory Sessions to JSON Web Tokens](https://www.ory.sh/docs/identities/session-to-jwt-cors#json-web-token-templates) [ory patch identity-config](https://www.ory.sh/docs/cli/ory-patch-identity-config).