{"id":20307274,"url":"https://github.com/oktadev/okta-shiro-plugin","last_synced_at":"2025-04-11T15:10:22.359Z","repository":{"id":43388268,"uuid":"259746335","full_name":"oktadev/okta-shiro-plugin","owner":"oktadev","description":"A library for integrating Okta into Apache Shiro based projects","archived":false,"fork":false,"pushed_at":"2024-01-16T20:46:10.000Z","size":437,"stargazers_count":1,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T11:11:32.905Z","etag":null,"topics":["java","jax-rs","oauth2","security","servlet","shiro"],"latest_commit_sha":null,"homepage":null,"language":"Groovy","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/oktadev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-28T20:38:49.000Z","updated_at":"2021-10-08T13:09:15.000Z","dependencies_parsed_at":"2022-07-08T21:31:20.424Z","dependency_job_id":null,"html_url":"https://github.com/oktadev/okta-shiro-plugin","commit_stats":null,"previous_names":["oktadeveloper/okta-shiro-plugin"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-shiro-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-shiro-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-shiro-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-shiro-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oktadev","download_url":"https://codeload.github.com/oktadev/okta-shiro-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248429105,"owners_count":21101783,"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":["java","jax-rs","oauth2","security","servlet","shiro"],"created_at":"2024-11-14T17:17:00.286Z","updated_at":"2025-04-11T15:10:22.334Z","avatar_url":"https://github.com/oktadev.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"[\u003cimg src=\"https://aws1.discourse-cdn.com/standard14/uploads/oktadev/original/1X/0c6402653dfb70edc661d4976a43a46f33e5e919.png\" align=\"right\" width=\"256px\"/\u003e](https://devforum.okta.com/)\n[![Maven Central](https://img.shields.io/maven-central/v/com.okta.shiro/okta-shiro-plugin.svg)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.okta.shiro%22%20a%3A%22okta-shiro-plugin%22)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n# Okta Shiro Plugin\n\n* [Release status](#release-status)\n* [Need help?](#need-help)\n* [Getting started](#getting-started)\n* [Usage guide](#usage-guide)\n* [Configuration reference](#configuration-reference)\n* [Building this project](#building-the-project)\n* [Contributing](#contributing)\n\nThis repository contains a Shiro Realm for Okta, for use with OAuth 2.0 Resource Servers.  This realm will validate Okta JWT access tokens.\n \nWe also publish these libraries for Java:\n \n* [Spring Boot Integration](https://github.com/okta/okta-spring-boot/)\n* [Okta JWT Verifier for Java](https://github.com/okta/okta-jwt-verifier-java)\n* [Management SDK](https://github.com/okta/okta-sdk-java)\n \nYou can learn more on the [Okta + Java][lang-landing] page in our documentation.\n \n## Release status\n\nThis library uses semantic versioning and follows Okta's [library version policy](https://developer.okta.com/code/library-versions/).\n\n:heavy_check_mark: The current stable major version series is: 1.x\n\n| Version | Status                    |\n| ------- | ------------------------- |\n| 0.x.0 | Beta |\n \nThe latest release can always be found on the [releases page][github-releases].\n \n## Need help?\n \nIf you run into problems using this project, you can\n \n* Ask questions on the [Okta Developer Forums][devforum]\n* Post [issues][github-issues] here on GitHub (for code errors)\n \n## Getting started\n \nTo use this Shiro (1.5+) realm you will need to include the following dependency:\n\nFor Apache Maven:\n\n``` xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.okta.shiro\u003c/groupId\u003e\n    \u003cartifactId\u003eokta-shiro-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e${okta.shiro.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nFor Gradle:\n\n```groovy\nruntime \"com.okta.shiro:okta-shiro-plugin:${okta.shiro.version}\"\n```\n\n### SNAPSHOT Dependencies\n\nSnapshots are deployed off of the 'master' branch to [OSSRH](https://oss.sonatype.org/) and can be consumed using the following repository configured for Apache Maven or Gradle:\n\n```txt\nhttps://oss.sonatype.org/content/repositories/snapshots/\n```\n\nYou'll also need:\n\n* An Okta account, called an _organization_ (sign up for a free [developer organization](https://developer.okta.com/signup) if you need one)\n* Another application configured to send access tokens to the project using this plugin.  You could use [Spring Cloud Gateway](https://developer.okta.com/blog/2020/01/08/secure-legacy-spring-cloud-gateway) \n \n## Usage guide\n\nThis plugin provides a Shiro Realm that will authenticate requests with an `Authorization: Bearer \u003caccess-token\u003e` header.\n\nTo use the realm, first [define and configure](https://shiro.apache.org/realm.html#realm-configuration) the `OktaResourceServerRealm`\n\n```ini\n[main]\n# define the realm\noktaRealm = com.okta.shiro.realm.OktaResourceServerRealm\n\n# Set the issuer to your Okta org\noktaRealm.issuer = https://{yourOktaDomain}/oauth2/default\n\n# Additionally, you can override the following default values\noktaRealm.audience = \"api://default\"\noktaRealm.groupClaim = \"groups\"\noktaRealm.nameClaim = \"sub\"\n\n[urls]\n# You must use the `authcBearer` filer to parse access token from the `Authorization` header\n/** = authcBearer\n```\n\nThe JWT claim information can be retrieved from the current Shiro `Subject` by casting the principal to `OktaJwtPrincipal`:\n\n```java\nimport com.okta.shiro.OktaJwtPrincipal;\n...\n\nOktaJwtPrincipal jwtPrincipal = (OktaJwtPrincipal) SecurityUtils.getSubject().getPrincipal();\n```\n\nSee the examples to help you get started even faster:\n\n* [JAX-RS](https://github.com/oktadeveloper/okta-shiro-plugin/tree/master/examples/jaxrs)\n* [Servlet](https://github.com/oktadeveloper/okta-shiro-plugin/tree/master/examples/servlet)\n\n## Building the Project\n\nIn most cases, you won't need to build this project from source. If you want to build it yourself, just clone the repo and run:\n \n ```sh\n./mvnw install\n```\n \n## Contributing\n \nWe're happy to accept contributions and PRs! Please see the [contribution guide](CONTRIBUTING.md) to understand how to structure a contribution.\n\n[devforum]: https://devforum.okta.com/\n[lang-landing]: https://developer.okta.com/code/java/\n[github-issues]: https://github.com/oktadeveloper/okta-shiro-plugin/issues\n[github-releases]: https://github.com/ooktadeveloper/okta-shiro-plugin/releases\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fokta-shiro-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foktadev%2Fokta-shiro-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fokta-shiro-plugin/lists"}