{"id":20231012,"url":"https://github.com/bewaremypower/kop-custom-auth-provider","last_synced_at":"2025-08-24T06:15:12.656Z","repository":{"id":109020316,"uuid":"600004323","full_name":"BewareMyPower/kop-custom-auth-provider","owner":"BewareMyPower","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-10T12:12:43.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-14T00:22:39.718Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BewareMyPower.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-10T11:16:09.000Z","updated_at":"2023-02-10T11:16:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"ca7139ba-fb8d-48ca-8237-0182f39dd82f","html_url":"https://github.com/BewareMyPower/kop-custom-auth-provider","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BewareMyPower%2Fkop-custom-auth-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BewareMyPower%2Fkop-custom-auth-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BewareMyPower%2Fkop-custom-auth-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BewareMyPower%2Fkop-custom-auth-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BewareMyPower","download_url":"https://codeload.github.com/BewareMyPower/kop-custom-auth-provider/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241677354,"owners_count":20001673,"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":[],"created_at":"2024-11-14T07:44:51.255Z","updated_at":"2025-03-03T13:42:55.460Z","avatar_url":"https://github.com/BewareMyPower.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kop-custom-auth-provider\n\n[KoP](https://github.com/streamnative/kop) with custom authentication provider.\n\n## Set up the KoP\n\nRun the [Ory Hydra](https://www.ory.sh/hydra/) as the OAuth2 authorization server:\n\n```bash\ndocker compose -f hydra/docker-compose.yml up -d\n```\n\n\u003e **NOTE**\n\u003e\n\u003e Make sure you have installed the following commands before going ahead:\n\u003e - `docker`\n\u003e - `jq`\n\u003e - `node`/`npm`\n\u003e - `javac`/`mvn`\n\nRun the following commands:\n\n```bash\n# Generate the standalone.conf\n./configure.sh\n# Build the custom authentication provider\ncd ./custom-auth\nmvn clean package\ncd -\n```\n\nThen, copy the `standalone.conf` and `*.nar` to the path of your Pulsar binary directory and run the standalone.\n\n```bash\n# Use Pulsar 2.10.3 and KoP 2.10.3.1 to test\n# The NAR package of KoP 2.10.3.1 is built with JDK 11, so you must run it in JRE 11 or higher.\n# Otherwise, you should build your own KoP from source.\ncurl -O -L https://archive.apache.org/dist/pulsar/pulsar-2.10.3/apache-pulsar-2.10.3-bin.tar.gz\ntar zxf apache-pulsar-2.10.3-bin.tar.gz\ncd apache-pulsar-2.10.3/\nmkdir protocols \u0026\u0026 cd protocols\ncurl -O -L https://github.com/streamnative/kop/releases/download/v2.10.3.1/pulsar-protocol-handler-kafka-2.10.3.1.nar\ncd ..\n\ncp ../standalone.conf ./conf/\ncp ../custom-auth/target/custom-auth-1.0-SNAPSHOT.jar ./lib/\n./bin/pulsar standalone -nss -nfw\n```\n\n## Test the Kafka client with OAuth2 authentication\n\n```bash\n# /tmp/client_credentials.json is the hard-coded path of the demo\ncp ./client_credentials.json /tmp/\ncd ./kafka-client-oauth2\nmvn clean package\nmvn exec:java -Dexec.mainClass=Main\n```\n\nYou will see the following output:\n\n```\nSent to offset 0\nReceived hello from offset 0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbewaremypower%2Fkop-custom-auth-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbewaremypower%2Fkop-custom-auth-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbewaremypower%2Fkop-custom-auth-provider/lists"}