{"id":26252742,"url":"https://github.com/kinde-oss/kinde-java-sdk","last_synced_at":"2026-05-04T08:02:13.868Z","repository":{"id":203625786,"uuid":"673639306","full_name":"kinde-oss/kinde-java-sdk","owner":"kinde-oss","description":"Kinde SDK for Java","archived":false,"fork":false,"pushed_at":"2026-04-27T22:58:52.000Z","size":1672,"stargazers_count":12,"open_issues_count":11,"forks_count":10,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-04-28T00:23:34.246Z","etag":null,"topics":["authentication","java","kinde","oauth2","springboot"],"latest_commit_sha":null,"homepage":"http://www.kinde.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kinde-oss.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-02T05:02:46.000Z","updated_at":"2026-03-25T04:29:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"1f439a91-c0bd-4b58-b42b-33973b27d701","html_url":"https://github.com/kinde-oss/kinde-java-sdk","commit_stats":null,"previous_names":["kinde-oss/kinde-java-sdk"],"tags_count":3,"template":false,"template_full_name":"kinde-oss/kinde-oss-repo-template","purl":"pkg:github/kinde-oss/kinde-java-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinde-oss%2Fkinde-java-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinde-oss%2Fkinde-java-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinde-oss%2Fkinde-java-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinde-oss%2Fkinde-java-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kinde-oss","download_url":"https://codeload.github.com/kinde-oss/kinde-java-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinde-oss%2Fkinde-java-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32599415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["authentication","java","kinde","oauth2","springboot"],"created_at":"2025-03-13T17:28:08.969Z","updated_at":"2026-05-04T08:02:13.844Z","avatar_url":"https://github.com/kinde-oss.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kinde Java SDK\n\nThe Kinde SDK for Java.\n\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com) [![Kinde Docs](https://img.shields.io/badge/Kinde-Docs-eee?style=flat-square)](https://kinde.com/docs/developer-tools) [![Kinde Community](https://img.shields.io/badge/Kinde-Community-eee?style=flat-square)](https://thekindecommunity.slack.com)\n\n## Development\n\nThis project contains an SDK package with a class called KindClientSDK. Inside this class, you will find all the main functions and methods that you need to use in another project. Any changes related to the SDK should be made through this file.\n\nAdditionally, within the SDK package, there is a callback controller class where we have implemented a method for handling callback requests. If you need to make any changes to the callback request processing, you should do so in this file.\n\nFurthermore, the SDK package includes sub-packages for enums, OAuth2, storage, and utilities. In the storage package, you will find functionality related to cookie storage, and within the OAuth2 package, we have classes for handling authorization code, client credentials, and PKCE (Proof Key for Code Exchange).\n\nThese components collectively make up the SDK, and you should make any necessary modifications or enhancements within the respective files to maintain and extend the SDK's functionality.\n\n### Project Dependencies\n\n#### Maven\n\nTo use this SDK, include the following POM dependency.\n\n```xml\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecom.kinde\u003c/groupId\u003e\n      \u003cartifactId\u003ekinde-core\u003c/artifactId\u003e\n      \u003cversion\u003e2.0.0\u003c/version\u003e\n    \u003c/dependency\u003e\n```\n\n#### Gradle\n\nTo use the SDK with a Gradle build process, please use the following dependency.\n\n```groovy\n    configuration('com.kinde:kinde-core:2.0.0')\n```\n\n### Building the SDK from Source\n\n1. Clone the repository to your machine:\n\n   ```bash\n   git clone https://github.com/kinde-oss/kinde-java-sdk\n   ```\n\n2. Go into the project:\n\n   ```bash\n   cd kinde-java-sdk\n   ```\n\n3. Install the dependencies:\n\n   ```bash\n   mvn -B clean package\n   ```\n\n## Documentation\n\nFor details on integrating this SDK into your project, head over to the [Kinde docs](https://kinde.com/docs/) and see the [Java SDK](\u003c[link-to-kinde-doc](https://kinde.com/docs/developer-tools/)\u003e) doc 👍🏼.\n\nMaven will automatically download the dependency from your local repository and make it available in your project.\n\n### Library Usage\n\n#### Set up the following environment variables\n\nThe following basic environmental variables are required at a minimum for connecting to Kinde. This will enable the development of an M2M client service.\n\n```shell\nexport KINDE_DOMAIN=https://\u003creplace\u003e.kinde.com # This is the domain you setup at kinde\nexport KINDE_CLIENT_ID=\u003creplace\u003e # the id for the client connecting to Kinde\nexport KINDE_CLIENT_SECRET=\u003creplace\u003e # the secret used to authenticate the client against Kinde\n```\n\nIf a user login is to be validated against Kinde, a redirect uri must be provided. \n\n```shell\nexport KINDE_REDIRECT_URI=http://localhost:8080/kinde-j2ee-app/login\n```\n\nThe redirect URI/URL used post successfull login. It is the URL that the PKCE client CODE will be set to. A query parameter of ?code='value' must be processed\n\n#### Setup .env environmental files.\n\nThe Kinde library supports .env files. They must be located in the directory from which the application is executed.\n\n```shell\nKINDE_DOMAIN=https://\u003creplace\u003e.kinde.com\nKINDE_CLIENT_ID=\u003creplace\u003e\nKINDE_CLIENT_SECRET=\u003creplace\u003e\nKINDE_REDIRECT_URI=http://localhost:8080/kinde-j2ee-app/login\n```\n\n#### Server Example\n\nTo make an M2M server token request onto Kinde, first set up the appropriate environmental variables\n\n##### By shell export\n\nRun these exports before running your service.\n\n```shell\nexport KINDE_DOMAIN=https://\u003creplace\u003e.kinde.com # This is the domain you setup at kinde\nexport KINDE_CLIENT_ID=\u003creplace\u003e # the id for the client connecting to Kinde\nexport KINDE_CLIENT_SECRET=\u003creplace\u003e # the secret used to authenticate the client against Kinde\n```\n\n##### By .env file config\n\nPlace this .env file in the directory from which you run your service.\n\n```shell\nKINDE_DOMAIN=https://\u003creplace\u003e.kinde.com\nKINDE_CLIENT_ID=\u003creplace\u003e\nKINDE_CLIENT_SECRET=\u003creplace\u003e\n```\n##### Programmatic configuration\n\nIf you want to pass in configuration programmatically, the KindeClientBuilder supports this, use the following approach.\n```java\nKindeClient kindeClient = KindeClientBuilder\n        .builder()\n        .domain(\"\u003creplace\u003e\")\n        .clientId(\"\u003creplace\u003e\")\n        .clientSecret(\"\u003creplace\u003e\")\n        .build();\n```\n\n##### Java Code to retrieve an M2M token.\nThe example below details how to implement a server level token request. This is needed for M2M communication and authorization.\n```java\nKindeClient kindeClient = KindeClientBuilder\n        .builder()\n        .build();\nKindeClientSession kindeClientSession = kindeClient.clientSession();\nKindeTokens tokens = kindeClientSession.retrieveTokens();\n        \n```\n\n### User Code Authorization Example (PKCE)\n\nTo authenticate a user on a client, the appropriate configuration must be in place.\n\n##### By shell export\n\nRun these exports before running your service.\n\n```shell\nexport KINDE_DOMAIN=https://\u003creplace\u003e.kinde.com # This is the domain you setup at kinde\nexport KINDE_CLIENT_ID=\u003creplace\u003e # the id for the client connecting to Kinde\nexport KINDE_CLIENT_SECRET=\u003creplace\u003e # the secret used to authenticate the client against Kinde\nexport KINDE_REDIRECT_URI=openid # the open id\n```\n\n##### By .env file config\n\nPlace this .env file in the directory from which you run your service.\n\n```shell\nKINDE_DOMAIN=https://\u003creplace\u003e.kinde.com\nKINDE_CLIENT_ID=\u003creplace\u003e\nKINDE_CLIENT_SECRET=\u003creplace\u003e\nKINDE_REDIRECT_URI=\u003creplace\u003e\nKINDE_SCOPES=openid\n```\n##### Programmatic configuration\nIf you want to pass in configuration programmatically the KindeClientBuilder supports this use the following approach.\n```java\nKindeClient kindeClient = KindeClientBuilder\n        .builder()\n        .domain(\"\u003creplace\u003e\")\n        .clientId(\"\u003creplace\u003e\")\n        .clientSecret(\"\u003creplace\u003e\")\n        .redirectUri(\"replace\")\n        .addScope(\"openid\")\n        .build();\n```\n\n##### Java code to generate the redirect URL\nBefore the PKCE code can be processed, a user must be directed to Kinde to log in. The client library can generate this URL as follows\n```java\nKindeClient kindeClient = KindeClientBuilder\n        .builder()\n        .build();\nKindeClientSession kindeClientSession = kindeClient.clientSession();\nAuthorizationUrl authorizationURL = kindeClientSession.authorizationUrl();\n```\nThe AuthorizationUrl contains the url and CodeVerify information. If using a code grant, the code verify needs to be stored for the redirct call. This can be done using the J2EE session. Here is an example\n```java\nreq.getSession().setAttribute(\"AuthorizationUrl\",authorizationUrl);\nresp.sendRedirect(authorizationUrl.getUrl().toString());\n```\n\n##### Code to request tokens upon redirect\nIf it is a code auth, then the AuthorizationUrl needs to be retrieved.\n```java\nAuthorizationUrl authorizationUrl = (AuthorizationUrl)req.getSession().getAttribute(\"AuthorizationUrl\");\n```\nThe token request looks like the following.\n```java\nKindeClient kindeClient = KindeClientBuilder\n        .builder()\n        .build();\nKindeTokens tokens = kindeClient.getKindeClient().initClientSession(code,authorizationUrl).retrieveTokens();\n```\n\n## Migration\n[Follow the migration guide](./MIGRATION.md)\n\n## Sub Projects\nThe Kinde-Java-Sdk is broken down into subprojects as follows:\n\n| Project Name                                   | Description                   |\n|------------------------------------------------|-------------------------------|\n| [kinde-core](kinde-core/README.md)             | The Core implementation       |\n| [kinde-j2ee](kinde-j2ee/README.md)             | The J2EE SDK implementation   |\n| [kinde-management](kinde-management/README.md) | The Management implmentation  |\n| [playground](playground/README.md)             | Example projects to work from |\n\n\n## Publishing\n\nThe core team handles publishing.\n\n- [ ] If we need to update the version of the SDK, we will have to update the value of the version in the \u003cversion\u003e tag in the pom.xml file.\n- [ ] After that, we will need to run mvn clean install.\n- [ ] Next, you will need to update the version value in both places - within the -Dversion parameter in the mvn install:install-file command and in the \u003cversion\u003e tag in the dependency entry added to the other project's pom.xml. Ensure that both places have the same version value to maintain consistency.\n\n## Contributing\n\nPlease refer to Kinde’s [contributing guidelines](https://github.com/kinde-oss/.github/blob/489e2ca9c3307c2b2e098a885e22f2239116394a/CONTRIBUTING.md).\n\n## License\n\nBy contributing to Kinde, you agree that your contributions will be licensed under its MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinde-oss%2Fkinde-java-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkinde-oss%2Fkinde-java-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinde-oss%2Fkinde-java-sdk/lists"}