This example app shows how to build a basic CRUD app with Spring Boot Kotlin, Spring Data, and Vue.js. Please read Build a CRUD App with Vue.js, Spring Boot, and Kotlin to see how this app was created.
Prerequisites:
Okta 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.
To install this example application, run the following commands:
git clone -b auth https://github.com/oktadeveloper/okta-kotlin-spring-boot-vue-example.git
cd okta-kotlin-spring-boot-vue-exampleThis will get a copy of the project installed locally. To install all of its dependencies and start each app, follow the instructions below.
To create a new OIDC app for Spring Boot on Okta:
- Log in to your developer account, navigate to Applications, and click on Add Application.
- Select Web and click Next.
- Give the application a name and add
http://localhost:9000/login/oauth2/code/oktaas a login redirect URI. - Click Done.
Add your issuer and client ID to server/src/main/resources/application.properties.
okta.oauth2.issuer=https://$YOUR_OKTA_DOMAIN/oauth2/default
okta.oauth2.clientId=$YOUR_CLIENT_IDNOTE: The value of $YOUR_OKTA_DOMAIN should be something like dev-123456.okta.com. Make sure you don't include -admin in the value!
Start your Spring Boot app by navigating to the server directory and starting your app.
cd server
./gradlew bootRunTo create a new OIDC app for Vue on Okta:
- Log in to your developer account, navigate to Applications, and click on Add Application.
- Select Single-Page App and click Next.
- Give the application a name, set the login redirect URI to
http://localhost:8080/callback, and click Done.
Copy the issuer and clientId into client/src/router.js.
Vue.use(Auth, {
issuer: 'https://$YOUR_OKTA_DOMAIN/oauth2/default',
clientId: '$YOUR_CLIENT_ID',
redirectUri: window.location.origin + '/callback'
});Navigate into the client folder and run:
npm install && yarn serveOpen your browser to http://localhost:8080, log in, and create todos to your hearts content!
This example uses the following open source libraries from Okta:
Please post any questions as comments on the blog post, or visit our Okta Developer Forums.
Apache 2.0, see LICENSE.