{"id":20307370,"url":"https://github.com/oktadev/okta-legacy-with-cloud-gateway-example","last_synced_at":"2025-08-19T14:19:59.114Z","repository":{"id":103824315,"uuid":"232601816","full_name":"oktadev/okta-legacy-with-cloud-gateway-example","owner":"oktadev","description":"Secure Legacy Applications with Spring Cloud Gateway","archived":false,"fork":false,"pushed_at":"2020-06-17T18:49:24.000Z","size":76,"stargazers_count":8,"open_issues_count":1,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-11T15:14:45.253Z","etag":null,"topics":["java","legacy","oauth2","secure","servlet","spring-cloud-gateway","tutorial"],"latest_commit_sha":null,"homepage":"","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":"2020-01-08T16:04:06.000Z","updated_at":"2025-01-02T00:54:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a169042-5214-4bc4-aa68-15709d980c42","html_url":"https://github.com/oktadev/okta-legacy-with-cloud-gateway-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oktadev/okta-legacy-with-cloud-gateway-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-legacy-with-cloud-gateway-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-legacy-with-cloud-gateway-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-legacy-with-cloud-gateway-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-legacy-with-cloud-gateway-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oktadev","download_url":"https://codeload.github.com/oktadev/okta-legacy-with-cloud-gateway-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-legacy-with-cloud-gateway-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271166404,"owners_count":24710481,"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-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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","legacy","oauth2","secure","servlet","spring-cloud-gateway","tutorial"],"created_at":"2024-11-14T17:17:26.584Z","updated_at":"2025-08-19T14:19:59.108Z","avatar_url":"https://github.com/oktadev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Secure Legacy Applications with Spring Cloud Gateway\n \nThis repository contains examples of how to secure a \"legacy\" servlet application Spring Cloud Gateway.\n\nThis repository has two examples in it:\n- `cloud-gateway` - A basic Spring Cloud Gateway application that proxies and secures downstream requests\n- `legacy-servlet-app` - A simple servlet application.\n\n* See the [Add OAuth 2.0 to Legacy Apps with Spring Cloud Gateway][blog-post] learn more about how these projects were created.\n\n**Prerequisites:** [Java 8](https://sdkman.io/sdks#java).\n\n* [Spring Boot + Spring Cloud Example](#spring-boot-gateway-example)\n* [Legacy Servlet Application Example](#legacy-servlet-application-example)\n* [Links](#links)\n* [Help](#help)\n* [License](#license)\n\n## Spring Cloud Gateway Example\n\nTo install this example, run the following commands:\n\n```bash\ngit clone https://github.com/oktadeveloper/okta-legacy-with-cloud-gateway-example.git\ncd okta-legacy-with-cloud-gateway-example/cloud-gateway\n```\n\n### Create a Web Application in Okta\n\nLog in to your Okta Developer account (or [sign up](https://developer.okta.com/signup/) if you don't have an account).\n\n1. From the **Applications** page, choose **Add Application**.\n2. On the Create New Application page, select **Web**.\n3. Give your app a memorable name, add `http://localhost:8080/login/oauth2/code/okta` as a Login redirect URI, select **Refresh Token** (in addition to **Authorization Code**), and click **Done**.\n\nCopy the issuer (found under **API** \u003e **Authorization Servers**), client ID, and client secret into the `src/main/resources/application.yml` file of the `cloud-gateway` project.\n\n```yaml\nokta:\n  oauth2:\n    issuer: https://{yourOktaDomain}/oauth2/default\n    client-id=$clientId\n    client-secret=$clientSecret\n```\n\nThen, run the project with: `./mvnw spring-boot:run`\n\n\n## Legacy Servlet Application Example\n\nIn a seperate terminal window (in the same git repostiory as above) run:\n\n```bash\ncd legacy-servlet-app\n./mvnw jetty:run -Dokta.oauth2.issuer=https://{yourOktaDomain}/oauth2/default\n```\n\n**NOTE:** the \"issuer\" must be the same in both projects.\n\nBrowse to `http://localhost:8080` in an incognito/private window to login and view the user profile data.\n\n## Links\n\nThese examples uses the following open source libraries:\n\n* [Okta Spring Boot Starter](https://github.com/okta/okta-spring-boot) \n* [Spring Boot](https://spring.io/projects/spring-boot)\n* [Spring Cloud Gateway](https://spring.io/projects/spring-cloud-gateway)\n* [Spring Security](https://spring.io/projects/spring-security)\n\n## Help\n\nPlease post any questions as comments on the example's [blog post][blog-post], or on the [Okta Developer Forums](https://devforum.okta.com/).\n\n## License\n\nApache 2.0, see [LICENSE](LICENSE).\n\n[blog-post]: https://developer.okta.com/blog/2020/01/08/secure-legacy-spring-cloud-gateway\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fokta-legacy-with-cloud-gateway-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foktadev%2Fokta-legacy-with-cloud-gateway-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fokta-legacy-with-cloud-gateway-example/lists"}