{"id":21974942,"url":"https://github.com/blaze-b/okta-spring-boot-saml-example","last_synced_at":"2026-04-29T20:03:53.205Z","repository":{"id":149530188,"uuid":"251560101","full_name":"blaze-b/okta-spring-boot-saml-example","owner":"blaze-b","description":"Sample  application to enable the SSO connectivity","archived":false,"fork":false,"pushed_at":"2020-03-31T09:58:46.000Z","size":1130,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-28T03:23:00.243Z","etag":null,"topics":["bottom","okta","sign","spring-boot","spring-saml"],"latest_commit_sha":null,"homepage":"https://developer.okta.com/blog/2017/03/16/spring-boot-saml","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/blaze-b.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}},"created_at":"2020-03-31T09:40:20.000Z","updated_at":"2021-01-16T17:36:16.000Z","dependencies_parsed_at":"2023-05-28T09:00:41.976Z","dependency_job_id":null,"html_url":"https://github.com/blaze-b/okta-spring-boot-saml-example","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/blaze-b%2Fokta-spring-boot-saml-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaze-b%2Fokta-spring-boot-saml-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaze-b%2Fokta-spring-boot-saml-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaze-b%2Fokta-spring-boot-saml-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blaze-b","download_url":"https://codeload.github.com/blaze-b/okta-spring-boot-saml-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245036123,"owners_count":20550661,"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":["bottom","okta","sign","spring-boot","spring-saml"],"created_at":"2024-11-29T15:48:42.676Z","updated_at":"2026-04-29T20:03:43.191Z","avatar_url":"https://github.com/blaze-b.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Boot, SAML, and Okta\n\nA Spring Boot example app that shows how to implement single sign-on (SSO) with Spring Security's SAML DSL and Okta.\n\nPlease read [Get Started with Spring Boot, SAML, and Okta](https://developer.okta.com/blog/2017/03/16/spring-boot-saml) to see how this app was created.\n\n**Prerequisites:** [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html).\n\n\u003e [Okta](https://developer.okta.com/) has Authentication and User Management APIs that reduce development time with instant-on, scalable user infrastructure. Okta's intuitive API and expert support make it easy for developers to authenticate, manage and secure users and roles in any application.\n\n* [Getting Started](#getting-started)\n* [Links](#links)\n* [Help](#help)\n* [License](#license)\n\n## Getting Started\n\nTo install this example application, run the following commands:\n\n```bash\ngit clone https://github.com/oktadeveloper/okta-spring-boot-saml-example.git\ncd okta-spring-boot-saml-example\n```\n\nThis will get a copy of the project installed locally. To install all of its dependencies and start the app, run:\n \n```bash\n./mvnw spring-boot:run\n```\n\n### Create a SAML App in Okta\n\nThe first thing you'll need to do is create an Okta account at [okta.com/integrate/signup](https://www.okta.com/integrate/signup/). After activating your account, log in to it. If you just created an account, you'll see a screen similar to the one below.\n\n\u003cimg src=\"static/okta-dev-console.png\" alt=\"Okta Dev Console\" width=\"800\"/\u003e\n \nClick on **\u003c \u003e Developer Console** in the top-left corner and switch to the Classic UI. If you see a screen like the following, you're good to go! The reason you need to use the Classic UI for this tutorial is because we haven't yet added SAML support to the [Developer Console](/blog/2017/09/25/all-new-developer-console).\n\n\u003cimg src=\"static/okta-classic-ui.png\" alt=\"Okta Classic UI\" width=\"800\"/\u003e\n\nClick **Add Applications** in the top right to continue. This will bring you to a screen with a **Create New App** green button on the left.\n\n\u003cimg src=\"static/create-new-app.png\" alt=\"Create New App\" width=\"800\"/\u003e\n\nClick the button and choose **Web** for the platform and **SAML 2.0** for the sign on method.\n\n\u003cimg src=\"static/new-app-saml-2.0.png\" alt=\"New App with SAML 2.0\" width=\"700\"/\u003e\n\nClick the **Create** button. The next screen will prompt you for an application name. I used \"Spring SAML”, but any name will work.\n\n\u003cimg src=\"static/app-name.png\" alt=\"Enter App name\" width=\"800\"/\u003e\n\nClick the **Next** button. This brings you to the second step, configuring SAML. Enter the following values:\n\n* Single sign on URL: `https://localhost:8443/saml/SSO`\n* Audience URI: `https://localhost:8443/saml/metadata`\n\n\u003cimg src=\"static/saml-integration.png\" alt=\"SAML Integration\" width=\"800\"/\u003e\n\nScroll to the bottom of the form and click **Next**. This will bring you to the third step, feedback. Choose \"I'm an Okta customer adding an internal app” and optionally select the App type.\n\n\u003cimg src=\"static/customer-or-partner.png\" alt=\"Customer or Partner\" width=\"800\"/\u003e\n\nClick the **Finish** button to continue. This will bring you to the application's \"Sign On” tab which has a section with a link to your applications metadata in a yellow box. Copy the **Identity Provider metadata** link as you'll need it to configure your Spring Boot application.\n\n\u003cimg src=\"static/saml-metadata.png\" alt=\"SAML Metadata\" width=\"800\"/\u003e\n\nThe final setup step you'll need is to assign people to the application. Click on the **Assignments** tab and the **Assign** \u003e **Assign to People** button. You'll see a list of people with your account in it.\n\n\u003cimg src=\"static/assign-people.png\" alt=\"Assign People\" width=\"600\"/\u003e\n\nClick the **Assign** button, accept the default username (your email), and click the **Done** button.\n\nUpdate `src/main/resources/application.properties`, to have the `metadata-url` for the app you just created. Make sure to use the \"Identity Provider metadata\" value you copied earlier (hint: you can find it again under the \"Sign On” tab in your Okta application).\n\n```properties\nserver.port = 8443\nserver.ssl.enabled = true\nserver.ssl.key-alias = spring\nserver.ssl.key-store = classpath:saml/keystore.jks\nserver.ssl.key-store-password = secret\n\nsecurity.saml2.metadata-url = \u003cyour metadata url\u003e\n```\n\n### Run the App and Login with Okta\n\nStart the app using your IDE or `mvn spring-boot:run` and navigate to `https://localhost:8443`. If you're using Chrome, you'll likely see a privacy error.\n\n\u003cimg src=\"static/connection-not-private.png\" alt=\"Connection Not Private\" width=\"800\"/\u003e\n\nClick the \"ADVANCED\" link at the bottom. Then click the \"proceed to localhost (unsafe)” link.\n\n\u003cimg src=\"static/connection-not-private-proceed.png\" alt=\"Proceed to localhost\" width=\"800\"/\u003e\n\nNext, you'll be redirected to Okta to sign in and redirected back to your app. If you're already logged in, you won't see anything from Okta. If you sign out from Okta, you'll see a login screen such as the one below.\n\n\u003cimg src=\"static/okta-login.png\" alt=\"Okta Login\" width=\"800\"/\u003e\n\nAfter you've logged in, you should see a screen like the one below.\n\n\u003cimg src=\"static/hello-saml.png\" alt=\"Hello SAML\" width=\"800\"/\u003e\n\n## Links\n\nThis example uses [Spring Security SAML DSL](https://github.com/spring-projects/spring-security-saml-dsl) to integrate with Okta. Kudos to the project's [spring-security-saml-dsl-sample for its instructions](https://github.com/spring-projects/spring-security-saml-dsl/blob/master/samples/spring-security-saml-dsl-sample/README.md).\n\n## Help\n\nPlease post any questions as comments on the [blog post](http://developer.okta.com/blog/2017/03/16/spring-boot-saml), or visit our [Okta Developer Forums](https://devforum.okta.com/). You can also email developers@okta.com if would like to create a support ticket.\n\n## License\n\nApache 2.0, see [LICENSE](LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblaze-b%2Fokta-spring-boot-saml-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblaze-b%2Fokta-spring-boot-saml-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblaze-b%2Fokta-spring-boot-saml-example/lists"}