Simple example demonstrates how to integrate Okta as Identity Provider into Wildfly application server (aka open source JBOSS) which serves as Service Provider by means of PicketLink framework. There are two SAML 2.0 bindings shown: REDIRECT in the sp-redirect module and POST in the sp-post correspondingly. This example extends couple of PicketLink classes (see sp-common classes) in order to overcome discrepancies in SAML 2.0 implementation between PicketLink and Okta.
First, we need to open access to our local SP from the Internet, so Okta IDP can send HTTP requests thereto. Instructions below assume you have established ngrok tunnel to the Wildfly instance running on your localhost. So, here is a link to ngrok
-
Install & run local instance of WildFly
-
Start tunnel to the local WildFly instance
$ ./ngrok http 8080 ngrok by @inconshreveable Tunnel Status online Version 2.0.25/2.0.25 Region United States (us) Web Interface http://127.0.0.1:4040 Forwarding http://xxxxxxxx.ngrok.io -> localhost:8080 Forwarding https://xxxxxxxx.ngrok.io -> localhost:8080
-
If you ran another sample before, clean up the WildFly configuration first:
mvn3 install -P clean
-
Install "sp" security domain to WildFly
$ mvn install -P conf -Dservice.url=http://xxxxxxxx.ngrok.io/hello -Didp.url=http://idp.oktadev.com
-
Build and install sample application
$ mvn install wildfly:deploy
-
Open http://localhost:8080/hello in browser
-
You will be redirected to Okta Development IDP
-
Put service url into "Issuer", "SP ACS URL" and "SP Audience URI" fields
-
Click "Sign In"
-
If you ran another sample before, clean up the WildFly configuration first:
mvn3 install -P clean
-
Install "sp" security domain to WildFly
$ mvn install -P conf -Dservice.url=http://xxxxxxxx.ngrok.io/hola -Didp.url=http://idp.oktadev.com
-
Build and install sample application
$ mvn install wildfly:deploy
-
Open http://localhost:8080/halo in browser
-
You will be redirected to Okta Development IDP
-
Put service url into "Issuer", "SP ACS URL" and "SP Audience URI" fields
-
Click "Sign In"