This is a companion repository to Stytch's SCIM API article
- Install Java and set JAVA_HOME environment variable
- Create an .env file from .env.example and fill in some credentials
- Run in terminal:
source .env
- Run in terminal:
mvn clean spring-boot:run
- Run
curl -u $SCIM_USER:$SCIM_PASSWORD http://localhost:8080/scim/v2/ServiceProviderConfig
- should show some JSON.
##Using Ngrok to expose API to internet To test this locally Okta you need to expose your local API to the internet. You can do this using ngrok. Install that here: https://ngrok.com/download OR by doing these commands:
curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null
echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list
sudo apt update && sudo apt install ngrok
Then do the following:
- Go to https://dashboard.ngrok.com/get-started/setup, login, copy your auth token
- Run
ngrok config add-authtoken <paste-your-auth-token-here>
- While your Spring Boot applicaiton is still running, run
ngrok http 8080
in another tab. - You'll see some output like
Forwarding https://xxxxxxxxxxxx.ngrok-free.app -> http://localhost:8080
- Use that base URL, do
curl -u $SCIM_USER:$SCIM_PASSWORD https://xxxxxxxxxxxx.ngrok-free.app/scim/v2/ServiceProviderConfig
- The same JSON should appear.