Git Product home page Git Product logo

rails-saml-sp's Introduction

A simple SAML rails client. You must have Ruby-on-Rails 5+, a postgres database engine available (spec'd in config/database.yml). See Shibboleth for Beginners-Part 1 for instructions on setting up a JumpCloud SAML (and LDAP) identity provider (IdP). Run the following commands to deploy locally (development):

% git clone https://github.com/johncallahan/rails-saml-sp.git
% cd rails-saml-sp
% bundle install
% openssl genrsa -out idp.pem 2048
% openssl req -new -x509 -sha256 -key idp.pem -out idp.crt -days 365
% export ASSET_HOST=http://localhost:3000
% export ENTITY_ID=<SAML entity id name>
% export IDP_SSO_URL=<SAML SSO url>
% export IDP_SLO_URL=<SAML SLO url>
% export IDP_CERT="$(cat idp.crt)"
% rake db:create
% rake db:migrate
% rails s

Visit http://localhost:3000 in a browser. To deploy on heroku, try:

% heroku create

Then, using the name it provides (for example, little-goat-12345 but yours will be different):

% heroku config:set HEROKU_APP_NAME=little-goat-12345
% heroku config:set ENTITY_ID=<SAML entity id name>
% heroku config:set IDP_SSO_URL=<SAML SSO url>
% heroku config:set IDP_SLO_URL=<SAML SLO url>
% heroku config:set IDP_CERT="$(cat idp.crt)"
% git push heroku master
% heroku run rake db:migrate

Then, visit https://little-goat-12345.herokuapp.com/

If you want to create additional sites:

% heroku create --remote other
% heroku config:set HEROKU_APP_NAME=big-sheep-98765 --remote other
% heroku config:set ENTITY_ID=<SAML entity id name> --remote other
% heroku config:set IDP_SSO_URL=<SAML SSO url> --remote other
% heroku config:set IDP_SLO_URL=<SAML SLO url> --remote other
% heroku config:set IDP_CERT="$(cat idp.crt)" --remote other
% git push other master
% heroku run rake db:migrate --remote other

Then, visit https:://big-sheep-98765.herokuapp.com/

With rails-saml-idp project,

export ASSET_HOST=http://localhost:3000
export ENTITY_ID=
export SP_NAME=http://localhost:3001/saml/auth
export IDP_CERT_FINGERPRINT="<fingerprint value SHA1>"
export IDP_CERT=
export IDP_SSO_URL=http://localhost:3001/saml/auth
export IDP_SLO_URL=http://localhost:3001/saml/auth?slo=true

rails-saml-sp's People

Contributors

johncallahan avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.