{"id":15013855,"url":"https://github.com/oktadev/auth0-java-rest-api-examples","last_synced_at":"2025-04-12T05:46:52.676Z","repository":{"id":175910440,"uuid":"654700037","full_name":"oktadev/auth0-java-rest-api-examples","owner":"oktadev","description":"Java REST API Examples","archived":false,"fork":false,"pushed_at":"2024-04-29T03:59:14.000Z","size":26028,"stargazers_count":23,"open_issues_count":10,"forks_count":14,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-04T17:07:34.192Z","etag":null,"topics":["graalvm","helidon","java","micronaut","quarkus","rest","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"HTML","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}},"created_at":"2023-06-16T18:18:04.000Z","updated_at":"2024-10-14T14:37:15.000Z","dependencies_parsed_at":"2023-10-22T22:25:05.869Z","dependency_job_id":"782118b6-5708-4cc8-9762-e545104d6a76","html_url":"https://github.com/oktadev/auth0-java-rest-api-examples","commit_stats":null,"previous_names":["oktadev/auth0-java-rest-api-examples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fauth0-java-rest-api-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fauth0-java-rest-api-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fauth0-java-rest-api-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fauth0-java-rest-api-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oktadev","download_url":"https://codeload.github.com/oktadev/auth0-java-rest-api-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239889028,"owners_count":19713702,"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":["graalvm","helidon","java","micronaut","quarkus","rest","spring-boot"],"created_at":"2024-09-24T19:44:51.459Z","updated_at":"2025-02-20T22:31:54.745Z","avatar_url":"https://github.com/oktadev.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java REST API Examples: Micronaut, Quarkus, Spring Boot, and Helidon\n\nThis repository contains example OAuth 2.0 resource servers built with Micronaut, Quarkus, Spring Boot, and Helidon. See [this demo script](demo.adoc) to learn how these apps were created.\n\nVisit [@oktadev/auth0-java-reactive-examples](https://github.com/oktadev/auth0-java-reactive-examples) for examples using the reactive versions of these frameworks.\n\n**Prerequisites:** [Java 21 with GraalVM](https://sdkman.io/) and [HTTPie](https://httpie.io/).\n\n* [Getting Started](#getting-started)\n* [Links](#links)\n* [Help](#help)\n* [License](#license)\n\n## Getting Started\n\nClick the button below to start a new Gitpod development environment:\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/oktadev/auth0-java-rest-api-examples)\n\nOr, if you'd rather try things locally, clone this repository:\n\n```bash\ngit clone https://github.com/oktadev/auth0-java-rest-api-examples.git\n```\n\nYou will need a JDK with GraalVM and its native-image compiler. Using [SDKMAN](https://sdkman.io), run the following command and set it as the default:\n\n```bash\nsdk install java 21.0.2-graalce\n```\n\nNext, you'll need a [free Auth0 developer account](https://auth0.com/signup). \n\nInstall the [Auth0 CLI](https://github.com/auth0/auth0-cli#installation) and run `auth0 login` to connect it to your account.\n\nCreate an access token using Auth0's CLI:\n\n```shell\nauth0 test token -a https://\u003cyour-auth0-domain\u003e/api/v2/ -s openid\n```\n\nSet the access token as a `TOKEN` environment variable in a terminal window.\n\n```shell\nTOKEN=eyJraWQiOiJYa2pXdjMzTDRBYU1ZSzNGM...\n```\n\nChange the following files for each framework to match your Auth0 domain:\n\n- Micronaut: `micronaut/src/main/resources/application.properties`\n- Quarkus: `quarkus/src/main/resources/application.properties`\n- Spring Boot: `spring-boot/src/main/resources/application.properties`\n- Helidon: `helidon/src/main/resources/META-INF/microprofile-config.properties`\n\nYou can start each app using its CLI, Gradle, or Maven. Note that you will only be able to start one at a time since they all run on port 8080.\n\n- Micronaut: `./gradlew run`\n- Micronaut [AOT](https://micronaut-projects.github.io/micronaut-gradle-plugin/latest/#_micronaut_aot_plugin): `./gradlew optimizedRun`\n- Quarkus: `quarkus dev`\n- Spring Boot: `./gradlew bootRun`\n- Helidon: `helidon dev`\n\nThen, you can test them with an access token and HTTPie.\n\nUse HTTPie to pass the JWT in as a bearer token in the `Authorization` header.\n\n```bash\nhttp :8080/hello Authorization:\"Bearer $TOKEN\"\n```\n\nYou should see your email address printed to your terminal.\n\nYou can also build and run each example as a native app.\n\n- Micronaut: `./gradlew nativeCompile`\n- Micronaut [AOT](https://micronaut-projects.github.io/micronaut-gradle-plugin/latest/#_micronaut_aot_plugin): `./gradlew nativeOptimizedCompile` - GraalVM executable compiled with Micronaut AOT optimizations\n- Quarkus: `quarkus build --native`\n- Spring Boot: `./gradlew nativeCompile`\n- Helidon: `mvn package -Pnative-image`\n\nThen, start each app as a native executable.\n\n- Micronaut: `./build/native/nativeCompile/app`\n- Micronaut AOT: `./build/native/nativeOptimizedCompile/app`\n- Quarkus: `./build/quarkus-1.0.0-SNAPSHOT-runner`\n- Spring Boot:  `./build/native/nativeCompile/spring-boot`\n- Helidon: `./target/helidon`\n\n## Links\n\nThis example uses the following open source libraries:\n\n* [Micronaut](https://micronaut.io)\n* [Quarkus](https://quarkus.io)\n* [Spring Boot](https://spring.io/projects/spring-boot)\n* [Helidon](https://helidon.io)\n\n## Help\n\nPlease post any questions as issues in this repo or on the [Auth0 Community Forums](https://community.auth0.com/).\n\n## License\n\nApache 2.0, see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fauth0-java-rest-api-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foktadev%2Fauth0-java-rest-api-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fauth0-java-rest-api-examples/lists"}