{"id":28891680,"url":"https://github.com/zitadel/client-java","last_synced_at":"2025-08-22T13:08:56.941Z","repository":{"id":290700280,"uuid":"955846133","full_name":"zitadel/client-java","owner":"zitadel","description":"Official Zitadel SDK for the JVM. Authenticate and access Zitadel's authentication and management APIs in JVM-based applications.","archived":false,"fork":false,"pushed_at":"2025-06-17T00:15:39.000Z","size":2120,"stargazers_count":3,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-17T00:21:25.043Z","etag":null,"topics":["client-lib","client-library","iam","sdk","sdk-java","zitadel","zitadel-sdk"],"latest_commit_sha":null,"homepage":"https://central.sonatype.com/artifact/com.zitadel/zitadel-java","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zitadel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-27T09:40:55.000Z","updated_at":"2025-06-16T18:40:04.000Z","dependencies_parsed_at":"2025-04-30T05:28:15.569Z","dependency_job_id":"5b7d0cbd-594c-4e34-a051-9e175e3c829f","html_url":"https://github.com/zitadel/client-java","commit_stats":null,"previous_names":["zitadel/client-java"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/zitadel/client-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zitadel%2Fclient-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zitadel%2Fclient-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zitadel%2Fclient-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zitadel%2Fclient-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zitadel","download_url":"https://codeload.github.com/zitadel/client-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zitadel%2Fclient-java/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261044124,"owners_count":23101824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client-lib","client-library","iam","sdk","sdk-java","zitadel","zitadel-sdk"],"created_at":"2025-06-21T01:05:17.133Z","updated_at":"2025-08-22T13:08:56.499Z","avatar_url":"https://github.com/zitadel.png","language":"Java","readme":"# Java SDK for Zitadel\n\nThis is the Zitadel Java SDK, designed to provide a convenient and idiomatic\nway to interact with the Zitadel APIs in Java. The SDK provides a seamless\nwrapping of the Zitadel API, making it easy to authenticate service users and\nperform API operations.\n\nThe SDK enables efficient integration with the Zitadel API, allowing you to\nmanage resources and execute actions. However, it's important to note that\nthis SDK is tailored for service users and is not intended for user\nauthentication scenarios. It does not support authentication mechanisms\nlike OAuth2, OIDC, or SAML for client applications, including web, mobile,\nor other environments. For these types of user authentication, you should\nuse other libraries that are designed for the specific platform and\nauthentication method.\n\n**Disclaimer**: This SDK is not suitable for implementing user authentication.\nIt does not handle authentication for client applications using OAuth2, OIDC,\nor SAML and should not be used for scenarios requiring such functionality.\nFor those use cases, consider using other solutions that are designed for\nuser authentication across various platforms like web, mobile, or other\nclient environments.\n\n\u003e [!IMPORTANT]\n\u003e Please be aware that this SDK is currently in an incubating stage. We are releasing it to the community to gather feedback and learn how it is being used. While you are welcome to use it, please note that the API and functionality may evolve based on community input. We encourage you to try it out and share your experiences, but advise caution when considering it for production environments as future updates may introduce changes.\n\n## Getting Started\n\n### Sign up for Zitadel\n\nTo use this SDK, you need a Zitadel account. Sign up at the official\nZitadel website and obtain the necessary credentials to access the API.\n\n### Minimum Requirements\n\nEnsure you have Java 8 or higher installed. You also need Maven to\ninstall dependencies.\n\n## Using the SDK\n\n### Installation\n\nInstall the SDK by running one of the following commands:\n\n```bash\ncomposer require zitadel/client\n```\n\n## Authentication Methods\n\nYour SDK offers three ways to authenticate with Zitadel. Each method has its\nown benefits—choose the one that fits your situation best.\n\n#### 1. Private Key JWT Authentication\n\n**What is it?**\nYou use a JSON Web Token (JWT) that you sign with a private key stored in a\nJSON file. This process creates a secure token.\n\n**When should you use it?**\n\n- **Best for production:** It offers strong security.\n- **Advanced control:** You can adjust token settings like expiration.\n\n**How do you use it?**\n\n1. Save your private key in a JSON file.\n2. Build the authenticator using the helper method.\n\n**Example:**\n\n```java\nimport com.zitadel.ApiException;\nimport com.zitadel.Zitadel;\nimport com.zitadel.model.UserServiceAddHumanUserRequest;\nimport com.zitadel.model.UserServiceAddHumanUserResponse;\nimport com.zitadel.model.UserServiceSetHumanEmail;\nimport com.zitadel.model.UserServiceSetHumanProfile;\n\nclass Demo {\n    public static void main(String[] args) throws ApiException {\n        Zitadel zitadel = Zitadel.withPrivateKey(\"https://example.us1.zitadel.cloud\", \"path/to/jwt-key.json\");\n\n        UserServiceAddHumanUserResponse response = zitadel.users.userServiceAddHumanUser(\n                new UserServiceAddHumanUserRequest()\n                        .username(\"john.doe\")\n                        .profile(new UserServiceSetHumanProfile()\n                                .givenName(\"John\")\n                                .familyName(\"Doe\"))\n                        .email(new UserServiceSetHumanEmail()\n                                .email(\"john@doe.com\"))\n        );\n        System.out.println(\"User created: \" + response);\n    }\n}\n```\n\n#### 2. Client Credentials Grant\n\n**What is it?**\nThis method uses a client ID and client secret to get a secure access token,\nwhich is then used to authenticate.\n\n**When should you use it?**\n\n- **Simple and straightforward:** Good for server-to-server communication.\n- **Trusted environments:** Use it when both servers are owned or trusted.\n\n**How do you use it?**\n\n1. Provide your client ID and client secret.\n2. Build the authenticator using the helper method.\n\n**Example:**\n\n```java\nimport com.zitadel.ApiException;\nimport com.zitadel.Zitadel;\nimport com.zitadel.model.UserServiceAddHumanUserRequest;\nimport com.zitadel.model.UserServiceAddHumanUserResponse;\nimport com.zitadel.model.UserServiceSetHumanEmail;\nimport com.zitadel.model.UserServiceSetHumanProfile;\n\nclass Demo {\n    public static void main(String[] args) throws ApiException {\n        Zitadel zitadel = Zitadel.withClientCredentials(\"https://example.us1.zitadel.cloud\", \"id\", \"secret\");\n\n        UserServiceAddHumanUserResponse response = zitadel.users.userServiceAddHumanUser(\n                new UserServiceAddHumanUserRequest()\n                        .username(\"john.doe\")\n                        .profile(new UserServiceSetHumanProfile()\n                                .givenName(\"John\")\n                                .familyName(\"Doe\"))\n                        .email(new UserServiceSetHumanEmail()\n                                .email(\"john@doe.com\"))\n        );\n        System.out.println(\"User created: \" + response);\n    }\n}\n```\n\n#### 3. Personal Access Tokens (PATs)\n\n**What is it?**\nA Personal Access Token (PAT) is a pre-generated token that you can use to\nauthenticate without exchanging credentials every time.\n\n**When should you use it?**\n\n- **Easy to use:** Great for development or testing scenarios.\n- **Quick setup:** No need for dynamic token generation.\n\n**How do you use it?**\n\n1. Obtain a valid personal access token from your account.\n2. Build the authenticator using the helper method.\n\n**Example:**\n\n```java\nimport com.zitadel.ApiException;\nimport com.zitadel.Zitadel;\nimport com.zitadel.model.UserServiceAddHumanUserRequest;\nimport com.zitadel.model.UserServiceAddHumanUserResponse;\nimport com.zitadel.model.UserServiceSetHumanEmail;\nimport com.zitadel.model.UserServiceSetHumanProfile;\n\nclass Demo {\n\n    public static void main(String[] args) throws ApiException {\n        Zitadel zitadel = Zitadel.withAccessToken(\"https://example.us1.zitadel.cloud\", \"token\");\n\n        UserServiceAddHumanUserResponse response = zitadel.users.userServiceAddHumanUser(\n                new UserServiceAddHumanUserRequest()\n                        .username(\"john.doe\")\n                        .profile(new UserServiceSetHumanProfile()\n                                .givenName(\"John\")\n                                .familyName(\"Doe\"))\n                        .email(new UserServiceSetHumanEmail()\n                                .email(\"john@doe.com\"))\n        );\n        System.out.println(\"User created: \" + response);\n    }\n}\n```\n\n---\n\nChoose the authentication method that best suits your needs based on your\nenvironment and security requirements. For more details, please refer to the\n[Zitadel documentation on authenticating service users](https://zitadel.com/docs/guides/integrate/service-users/authenticate-service-users).\n\n### Debugging\n\nThe SDK supports debug logging, which can be enabled for troubleshooting\nand debugging purposes. You can enable debug logging by setting the `debug`\nflag to `true` when initializing the `Zitadel` client, like this:\n\n```java\nZitadel zitadel = new Zitadel(\"your-zitadel-base-url\", 'your-valid-token', apiClient -\u003e apiClient.setDebugging(true));\n```\n\nWhen enabled, the SDK will log additional information, such as HTTP request\nand response details, which can be useful for identifying issues in the\nintegration or troubleshooting unexpected behavior.\n\n## Design and Dependencies\n\nThis SDK is designed to be lean and efficient, focusing on providing a\nstreamlined way to interact with the Zitadel API. It relies on the commonly used\nApache HTTP Client for making requests, which ensures that\nthe SDK integrates well with other libraries and provides flexibility\nin terms of request handling and error management.\n\n## Versioning\n\nA key aspect of our strategy is that the SDK's major version is synchronized with the ZITADEL core project's major version to ensure compatibility. For a detailed explanation of this policy and our release schedule, please see our [Versioning Guide](VERSIONING.md).\n\n## Contributing\n\nThis repository is autogenerated. We do not accept direct contributions.\nInstead, please open an issue for any bugs or feature requests.\n\n## Reporting Issues\n\nIf you encounter any issues or have suggestions for improvements, please\nopen an issue in the [issue tracker](https://github.com/zitadel/client-java/issues).\nWhen reporting an issue, please provide the following information to help\nus address it more effectively:\n\n- A detailed description of the problem or feature request\n- Steps to reproduce the issue (if applicable)\n- Any relevant error messages or logs\n- Environment details (e.g., OS version, relevant configurations)\n\n## Support\n\nIf you need help setting up or configuring the SDK (or anything\nZitadel), please head over to the [Zitadel Community on Discord](https://zitadel.com/chat).\n\nThere are many helpful people in our Discord community who are ready to\nassist you.\n\nCloud and enterprise customers can additionally reach us privately via our\n[support communication channels](https://zitadel.com/docs/legal/service-description/support-services).\n\n## License\n\nThis SDK is distributed under the Apache 2.0 License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzitadel%2Fclient-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzitadel%2Fclient-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzitadel%2Fclient-java/lists"}