{"id":27255619,"url":"https://github.com/bric3/xpack-oauth-plugin","last_synced_at":"2026-05-15T18:03:02.832Z","repository":{"id":142486866,"uuid":"119984923","full_name":"bric3/xpack-oauth-plugin","owner":"bric3","description":"Elasticsearch XPack plugin that adds a very simple OAuth2 realm to XPack (and to Shield for pre 5.0) ","archived":false,"fork":false,"pushed_at":"2018-02-02T17:33:07.000Z","size":205,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T02:42:25.876Z","etag":null,"topics":["elasticsearch","oauth2","plugin","shield","xpack"],"latest_commit_sha":null,"homepage":null,"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/bric3.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-header.txt","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,"zenodo":null}},"created_at":"2018-02-02T13:27:44.000Z","updated_at":"2018-02-09T03:51:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"b6838f0f-c9b3-475c-9cb6-1f5ced97e0b1","html_url":"https://github.com/bric3/xpack-oauth-plugin","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/bric3/xpack-oauth-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bric3%2Fxpack-oauth-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bric3%2Fxpack-oauth-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bric3%2Fxpack-oauth-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bric3%2Fxpack-oauth-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bric3","download_url":"https://codeload.github.com/bric3/xpack-oauth-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bric3%2Fxpack-oauth-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33074395,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["elasticsearch","oauth2","plugin","shield","xpack"],"created_at":"2025-04-11T02:20:33.318Z","updated_at":"2026-05-15T18:03:02.826Z","avatar_url":"https://github.com/bric3.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= OAuth Shield Plugin for ElasticSearch 5.4\n\nMinimum gradle version : 3.3 as Elasticsearch 5.4 migrated to version 3.3, this project was created with gradle 3.5\n\n== Run it simple\n\nRun ES with this plugin installed.\n... then run integration tests\n\n[source,sh]\n----\n./gradle integTestCluster\\#start\n----\n\nDefault user is `admin_user` with password : `changeme` (see task `integTestCluster` in `build.gradle` file).\nTo connect to the instance :\n\n[source,sh]\n----\ncurl -v --user admin_user:changeme -XGET 'localhost:9400/_cluster/settings' | jq '.'\n----\n\n\n== Configure the plugin\n\n[source,yaml]\n----\nxpack.security:\n  audit.enabled: true\n  authc:\n    realms:\n      your-oauth-realm-name:\n        order: 0\n        type: oauth\n        files.role_mapping: config/x-pack/oauth_role_mapping.yml\n        idp:\n          connection-timeout-in-millis: 10000 # optional connection tiemout, defaults to 10s\n          read-timeout-in-millis: 10000       # optional read response timeout, defaults to 10s\n          write-timeout-in-millis: 10000      # optional write request timeout, defaults to 10s\n          max-idle-connections: 200           # optional max number of connections, defaults to 200 connections\n          proxy:\n            host: xxx       # optional\n            port: xxx       # mandatory if host is declared\n            username: xxx   # optional if host is declared\n            password: xxx   # mandatory if username is declared\n\n        token-info:\n          url: https:/authority/path/to/tokeninfo # mandatory token-info url\n          field:\n            user: \"user_id\"          # mandatory user id field name in token json payload\n            scope: \"scope\"           # mandatory scope field name in token json payload\n            expires-in: \"expires_in\" # mandatory expiration field name in token json payload\n            expires-in.unit: SECONDS # optional time unit of expiration (values from java.time.temporal.ChronoUnit)\n          cache:\n            max-size : 20000         # optional max cache size, defaults to 20000 entries\n            expire-in-seconds : 300  # optional cache entry expiration, defaults to 5min\n----\n\n\n\n== Debug the plugin\n\nThese steps indicate how to install a debug agent on the ES instance started by gradle.\n\n1. For example set breakpoint at the extension loading here\n    `OAuthRealmExtention.getRealms`\n    that is only executed at the ES startup\n\n2. In your IDE -- _IntelliJ IDEA, let's be serous there_ -- create a remote debug\n   configuration in **attach** mode, on port 8000\n\n3. Start Elasticsearch via gradle with the property `debug` set to `true` :\n\n       ./gradlew integTestCluster\\#start -Pdebug=true\n\n4. Start the debug configuration in your IDE\n\n5. Have fun debugging\n\n6. To kill ES just run either :\n\n      ./gradlew integTestCluster\\#stop\n\n      kill $(jps | grep Elasticsearch | cut -f 1 -d ' ')\n\n\n== Run integration tests\n\n[source,sh]\n----\n./gradlew integTest\n----\n\n== Packages the plugin\n\n[source,sh]\n----\n./gradlew buildZip\n----\n\nThe plugin zip file will be located in `build/distributions/plugin.zip`, e.g. `build/distributions/x-pack-oauth-realm-0.5-xpack_5.4.0.zip`\n\n== Run everything\n\n[source,sh]\n----\n./gradlew build\n----\n\n== What does it do ?\n\nWhat the extension does in a nutshell :\n\nimage::oauth-authentication.png[OAuth Authentication]\n\nAlso check the OAuth RFC : https://tools.ietf.org/html/rfc6750\n\n== TODO\n\n- [x] Cache tokens\n- [x] Reload mapping\n- [x] Investigate `RefreshListener`\n- [x] Dependency Injection / avoid it because ES 5 drops guice\n- [x] Automate testing\n- [x] Logging, via shield configuration\n- [x] Configurable token info field to lookup\n- [x] truststore, company internal certificate authority =\u003e Not necessary\n      (Removed usage of Shield's own `ClientSSLService` because it doesn't allow multiple additional trust manager)\n- [x] ES 2.3\n- [x] Remove maven warning due to variable usage in project version, not necessary with gradle\n- [x] Migrate to Elasticsearch 5.4\n\n== Information\n\nThis plugin is loosely based on the example provided https://github.com/elastic/shield-custom-realm-example/tree/5.4[here].\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbric3%2Fxpack-oauth-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbric3%2Fxpack-oauth-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbric3%2Fxpack-oauth-plugin/lists"}