{"id":22997720,"url":"https://github.com/ssoready/ssoready-example-app-ruby-rails-saml","last_synced_at":"2026-04-26T23:31:58.499Z","repository":{"id":263876206,"uuid":"891658543","full_name":"ssoready/ssoready-example-app-ruby-rails-saml","owner":"ssoready","description":"Example app with SAML support, built with Ruby + Rails + SSOReady","archived":false,"fork":false,"pushed_at":"2025-03-05T15:54:33.000Z","size":104,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T13:24:24.435Z","etag":null,"topics":["api","example-app","example-project","ruby","ruby-on-rails","saml-authentication","saml-service-provider","saml-sp","saml-sso","saml2","saml2-sp-sso"],"latest_commit_sha":null,"homepage":"https://ssoready.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ssoready.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-20T18:12:53.000Z","updated_at":"2024-12-09T17:19:00.000Z","dependencies_parsed_at":"2024-11-20T19:32:55.542Z","dependency_job_id":"3d04be07-bb3e-4e0e-ac55-1734836625e1","html_url":"https://github.com/ssoready/ssoready-example-app-ruby-rails-saml","commit_stats":null,"previous_names":["ssoready/ssoready-example-app-ruby-rails-saml"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ssoready/ssoready-example-app-ruby-rails-saml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssoready%2Fssoready-example-app-ruby-rails-saml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssoready%2Fssoready-example-app-ruby-rails-saml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssoready%2Fssoready-example-app-ruby-rails-saml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssoready%2Fssoready-example-app-ruby-rails-saml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssoready","download_url":"https://codeload.github.com/ssoready/ssoready-example-app-ruby-rails-saml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssoready%2Fssoready-example-app-ruby-rails-saml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32317163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"ssl_error","status_checked_at":"2026-04-26T23:26:25.802Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","example-app","example-project","ruby","ruby-on-rails","saml-authentication","saml-service-provider","saml-sp","saml-sso","saml2","saml2-sp-sso"],"created_at":"2024-12-15T06:08:13.900Z","updated_at":"2026-04-26T23:31:58.478Z","avatar_url":"https://github.com/ssoready.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://i.imgur.com/oaig6Au.gif)\n\n# SSOReady Example App: Ruby + Rails with SAML\n\nThis repo contains a minimal example app built with Ruby and Rails that\nsupports [SAML](https://ssoready.com/docs/saml/saml-quickstart) using the\n[SSOReady Ruby SDK](https://github.com/ssoready/ssoready-ruby).\n\n[SSOReady](https://github.com/ssoready/ssoready) is an open-source way to add\nSAML and SCIM support to your application.\n\n## Running it yourself\n\nTo check out this repo yourself, you'll need a working installation of Ruby.\nThen, run:\n\n```\ngit clone https://github.com/ssoready/ssoready-example-app-ruby-rails-saml\ncd ssoready-example-app-ruby-rails-saml\n\nbundle install\nbundle exec rails s\n```\n\nThen, visit http://localhost:3000.\n\n## How it works\n\n![](https://i.imgur.com/DkcXB4F.png)\n\nThere are two steps involved in implementing SAML:\n\n1. Initiating SAML logins, where you redirect the user to their corporate\n   identity provider\n2. Handling SAML logins, where you log the user in after they've authenticated\n   using SAML.\n\n### Initiating SAML logins\n\nIn this demo app, initiating SAML logins happens from the `/saml-redirect`\nendpoint:\n\n```rb\nclass HomeController \u003c ApplicationController\n  def saml_redirect\n    get_redirect_result = ssoready.saml.get_saml_redirect_url(\n      # convert \"john.doe@example.com\" into \"example.com\".\n      organization_external_id: params[:email].split(\"@\").last\n    )\n    redirect_to(get_redirect_result.redirect_url, allow_other_host: true)\n  end\nend\n```\n\nYou initiate a SAML login by calling\n[`saml.get_saml_redirect_url`](https://ssoready.com/docs/api-reference/saml/get-saml-redirect-url)\nand redirecting to the returned URL.\n\nThe\n[`organization_external_id`](https://ssoready.com/docs/api-reference/saml/get-saml-redirect-url#request.body.organizationExternalId)\nis to tell SSOReady which customer's corporate identity provider you want to\nredirect to. In the demo app, we use `example.com` or `example.org` as the\n[organization external\nID](https://ssoready.com/docs/ssoready-concepts/organizations#organization-external-id).\n\n### Handling SAML logins\n\nAfter your user finishes authenticating over SAML, SSOReady will redirect them\nback to your application. In this demo app, that callback URL is configured to\nbe `http://localhost:3000/ssoready-callback`, so you'll get requests that look\nlike this:\n\n```\nGET http://localhost:3000/ssoready-callback?saml_access_code=saml_access_code_...\n```\n\nHere's how the demo app handles those requests:\n\n```rb\nclass HomeController \u003c ApplicationController\n  def ssoready_callback\n    redeem_result = ssoready.saml.redeem_saml_access_code(\n      saml_access_code: params[:saml_access_code]\n    )\n\n    # upsert a user by email and log in as them\n    user = User.find_or_create_by(email: redeem_result.email)\n    sign_in(user)\n    redirect_to(\"/\")\n  end\nend\n```\n\nYou handle a SAML login by calling\n[`saml.redeem_saml_access_code`](https://ssoready.com/docs/api-reference/saml/redeem-saml-access-code)\nwith the `saml_access_code` query parameter value, and logging the user in from\nthe `email` SSOReady returns to you.\n\nAnd that's it! That's all the code you have to write to add SAML support to your\napplication.\n\n### Configuring SSOReady\n\nTo make this demo app work out of the box, we did some work for you. You'll need\nto follow these steps yourself when you integrate SAML into your app.\n\nThe steps we took were:\n\n1. We signed up for SSOReady at https://app.ssoready.com.\n2. We created an\n   [environment](https://ssoready.com/docs/ssoready-concepts/environments), and\n   configured its [redirect\n   URL](https://ssoready.com/docs/ssoready-concepts/environments#redirect-url)\n   to be `http://localhost:3000/ssoready-callback`.\n3. We created an [API\n   key](https://ssoready.com/docs/ssoready-concepts/environments#api-keys).\n   Because this is a demo app, we hard-coded the API key. In production apps,\n   you'll instead put that API key secret into an `SSOREADY_API_KEY` environment\n   variable on your backend.\n4. We created two\n   [organizations](https://ssoready.com/docs/ssoready-concepts/organizations),\n   both of which use [DummyIDP.com](https://ssoready.com/docs/dummyidp) as their\n   \"corporate\" identity provider:\n\n   - One organization has [external\n     ID](https://ssoready.com/docs/ssoready-concepts/organizations#organization-external-id)\n     `example.com` and a [domain\n     whitelist](https://ssoready.com/docs/ssoready-concepts/organizations#domains)\n     of just `example.com`.\n   - The second organization has extnernal ID `example.org` and domain whitelist\n     `example.org`.\n\nIn production, you'll create a separate organization for each company that wants\nSAML. Your customers won't be using [DummyIDP.com](https://dummyidp.com); that's\njust a SAML testing service that SSOReady offers for free. Your customers will\ninstead be using vendors including\n[Okta](https://www.okta.com/products/single-sign-on-customer-identity/),\n[Microsoft\nEntra](https://www.microsoft.com/en-us/security/business/microsoft-entra), and\n[Google Workspace](https://workspace.google.com/). From your code's perspective,\nthose vendors will all look exactly the same.\n\n## Next steps\n\nThis demo app gives you a crash-course demo of how to implement SAML end-to-end.\nIf you want to see how this all fits together in greater detail, with every step\ndescribed in greater detail, check out the [SAML\nquickstart](https://ssoready.com/docs/saml/saml-quickstart) or the rest of the\n[SSOReady docs](https://ssoready.com/docs).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssoready%2Fssoready-example-app-ruby-rails-saml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssoready%2Fssoready-example-app-ruby-rails-saml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssoready%2Fssoready-example-app-ruby-rails-saml/lists"}