Create and deploy your custom app in less time with fewer errors using sample code and Terraform automation provided by Okta. In 90 minutes or less, you’ll learn how to do user mappings and assignments, and deploy your app into production. Easily tweak what you learn for your other apps. Developers, DevOps, and DevSecOps will benefit from this lab that showcases a typical CIAM use case.
This repo includes the following Terraform configurations.
- Use the Okta Terraform Provider to configure your SPA app in your Okta Org.
- Create a new ASA project, assign server access, and create an enrollment token with the Okta ASA Terraform Provider.
- Leverage an AWS ASA Starter Kit terraform config to create an Ubuntu application server and deploy your application.
The repo also includes several scripts to copy output data between the configurations.
This section covers configuring the environment that is required to complete this Okta Developer Day lab.
Please allow up to an hour to complete the setup tasks.
In addition to the following, you can view this environment setup video.
- Developer or Sandbox org
- ASA Team with provisioning enabled
- ASA Client
- Terraform
- Git command-line client
- Bash (Linux, MacOS or Git Bash)
- AWS account (non-production)
- Node.js (optional)
After you have all the prerequisites, you must complete the setup to start this Lab.
Follow the setup tasks in the 0_setup directory of this repo.
There are 3 ways to complete the labs.
- Follow along in this video.
- Download the slides from this repo.
- Follow the steps listed here in this README.
-
Clone this repo to a machine where you have Terraform installed.
git clone https://github.com/OktaEdu/deploy-a-custom-app.git
-
Edit the terraform.tfvars for the Okta Org config.
terraform init
terraform apply
-
You now have the following in your org:
- My SPA App Test Users group
- spa.user1 user
- My Vue SPA OAuth app
- The user is assigned to the group, which is assigned to the app
- Run the
2_copy_clientid.sh
script to update the app server config with the OAuth client id and secret from your Org. - Follow the instructions to run the ASA Terraform config.
- You now have a new ASA project,
My_Spa_App
, with an enrollment token. - Run the
4_copy_enrollment_token.sh
script to copy the ASA enrollment token to the app server config. - Update the following lines in the
terraform.tfvars
file in the 5_app_server directory.
- access_key = "yourAWSaccesskey"
- secret_key = "yourAWSsecretkey"
- org_url = "https://yoursandboxorg.oktapreview.com"
- Run the 5_app_server terraform config.
- Note the public IP address that your app server is assigned by AWS.
- After your app server is deployed it will take a few minutes to configure the web server and the Vue application.
- Before you login to the app, run the
6_update_spa_app.sh
script to update the app redirect URL in your Okta Org. - Access the app at https://public_ip_address/ and login