{"id":20307317,"url":"https://github.com/oktadev/okta-play-oidc-example","last_synced_at":"2025-07-22T04:04:35.262Z","repository":{"id":103824358,"uuid":"108012802","full_name":"oktadev/okta-play-oidc-example","owner":"oktadev","description":"Example of doing OIDC Authentication with Play, Pac4j, and Okta","archived":false,"fork":false,"pushed_at":"2020-04-02T17:14:30.000Z","size":54,"stargazers_count":7,"open_issues_count":1,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-11T15:14:46.641Z","etag":null,"topics":["java","oidc","okta","pac4j","playframework"],"latest_commit_sha":null,"homepage":"https://developer.okta.com/blog/2017/10/31/add-authentication-to-play-framework-with-oidc","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/oktadev.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-10-23T17:05:19.000Z","updated_at":"2023-03-28T02:31:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"e89e03c7-dc60-46f8-8208-851c2f0bc566","html_url":"https://github.com/oktadev/okta-play-oidc-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oktadev/okta-play-oidc-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-play-oidc-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-play-oidc-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-play-oidc-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-play-oidc-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oktadev","download_url":"https://codeload.github.com/oktadev/okta-play-oidc-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-play-oidc-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266424014,"owners_count":23926123,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["java","oidc","okta","pac4j","playframework"],"created_at":"2024-11-14T17:17:11.653Z","updated_at":"2025-07-22T04:04:35.253Z","avatar_url":"https://github.com/oktadev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OIDC Authentication with Play, Pac4j, and Okta\n\n\u003cdiv style=\"vertical-align: top\"\u003e\n  \u003ca href=\"https://www.playframework.com/assets/images/logos/play_full_color.png\"\u003e\n    \u003cimg src=\"https://www.playframework.com/assets/images/logos/play_full_color.png\" width=\"300\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pac4j.github.io\"\u003e\n    \u003cimg src=\"http://www.pac4j.org/img/logo-play.png\" width=\"200\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://developer.okta.com/\"\u003e\n    \u003cimg src=\"https://aws1.discourse-cdn.com/standard14/uploads/oktadev/original/1X/0c6402653dfb70edc661d4976a43a46f33e5e919.png\" width=\"500\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\nThis `okta-play-oidc-example` project is a Java Play Framework app that shows how to use the [play-pac4j-java](https://github.com/pac4j/play-pac4j) security library with OpenID Connect (OIDC) and Okta.\n\n**Prerequisites**: \n\n* Install [Java 8](https://adoptopenjdk.net/)\n* Install [sbt](https://www.scala-sbt.org/1.x/docs/Setup.html)\n\n## Create an OIDC App in Okta\n\nCreate an OIDC App in Okta to get a `{clientId}` and `{clientSecret}`. To do this, log in to your [Okta Developer](https://developer.okta.com/) account and navigate to **Applications** \u003e **Add Application**. Click **Web** and click the **Next** button. Give the app a name you’ll remember, specify `http://localhost:9000` as a Base URI, as well as the following values:\n \n * Login redirect URIs: `http://localhost:9000/callback?client_name=OidcClient`\n * Logout redirect URIs: `http://localhost:9000/?forcepostlogouturlafteridp`\n\nClick **Done** and copy the client ID and secret into your `conf/application.conf` file. While you're in there, modify the `oidc.discoveryUri` to match your Okta domain. For example:\n\n```typescript\noidc.discoveryUri = \"https://{yourOktaDomain}.com/oauth2/default/.well-known/openid-configuration\"\n```\n\nYou can also create groups and include them as claims. For example, create `ROLE_ADMIN` and `ROLE_USER` groups and add users into them.\n\nNavigate to **API** \u003e **Authorization Servers**, click the **Authorization Servers** tab and edit the `default` one. Click the **Claims** tab and **Add Claim**. Name it \"groups\" or \"roles\", and include it in the ID Token. Set the value type to \"Groups\" and set the filter to be a Regex of `.*`.\n\nAfter making these changes, you should be good to go! \n\n## Build and Run\n\nBuild the project and launch the Play app on [http://localhost:9000](http://localhost:9000):\n\n    sbt run\n\nIf you have any issues, please create an issue in this project and I'll do my best to help.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fokta-play-oidc-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foktadev%2Fokta-play-oidc-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fokta-play-oidc-example/lists"}