A minimal Ruby implementation of SAML Single Sign-On (SSO) with Okta as the Identity Provider (IdP).
- Ruby 3.0+
- Bundler
- An Okta developer account
- A configured SAML application in Okta
- Clone the repository.
git clone https://github.com/your-repo/saml-sso-ruby.git
cd saml-sso-ruby
-
Install Dependencies with
make puma-dev. -
Load & configure Environment Variables
touch .env && cat .env.example > .env -
Create IDP on okta developer dashboard
- Download the Okta certificate from your Okta SAML application settings.
- Save it as cert/okta_cert.pem.
-
If you want SAML assertion to be encrypted then follow this step:
- Run the below command to generate a private key and certificate.
- Upload the generated certificate.crt to your Okta SAML application settings for assertion encryption.
- and set
IS_ASSERTION_ENCRYPTEDtotrue
openssl req -x509 -nodes -sha256 -days 3650 -newkey rsa:2048 -keyout cert/private.key -out cert/certificate.crt
- Start the server using puma-dev (i.e, run
make run)