This example app shows how to package a Spring Boot application with Docker. See Add Docker to Your Spring Boot Application to see how it was built.
- Java 8: If you don’t have Java 8, you can install OpenJDK. Instructions are found on the OpenJDK website.
- Docker - We recommend https://www.docker.com/products/docker-desktop[Docker Desktop]
- Okta Developer Account: Go to the Okta website and sign up for a free developer account, if you haven’t already.
Okta has Authentication and User Management APIs that reduce development time with instant-on, scalable user infrastructure. Okta's REST API and makes it easy for developers to authenticate, manage, and secure users + roles in any application.
To install this example application, run the following commands:
git clone https://github.com/oktadeveloper/spring-boot-docker-example.git
If you don't have an Okta developer account, please create one. Then, create a new OIDC app on Okta:
- Log in to your developer account, navigate to Applications > Add Application.
- Select Web > Next.
- Give the application a name
- The rest of the default values will work. Click Done.
You need to add the Client ID and Secret from newly created Okta application, and the Issuer URI from your Okta account to the src/main/resources/application.properties
file. To find your Issuer URI, go to API -> Authorizaiton Servers.
okta.oauth2.issuer=https://{yourOktaUrl}/oauth2/default
okta.oauth2.client-id={yourClientId}
okta.oauth2.client-secret={yourClientSecret}
To run the Spring Boot application
./mvnw spring-boot:run
See the [blog post] for details on building the Docker container and managing your configuration.
Please post any questions as comments on the [blog post] or post them to Stack Overflow with the okta
tag.
Apache 2.0, see LICENSE.