This is an example Ruby project that leverages Sinatra to illustrate how to easily implement Widen's Simple One-Way SSO, complete with fully functional examples.
Simply clone and run:
$ git clone [email protected]:widen/widen-sso-examples
$ cd widen-sso-examples/widen-simple-one-way-sso-ruby
$ bundle install
$ bundle exec ruby app.rb
A running web application can now be accessed from http://localhost:8080 with the following resources available:
- http://localhost:8080/ - Root page with links to the following:
- http://localhost:8080/post (HTTP POST Example)
- http://localhost:8080/get (HTTP GET Example)
There are two configuration properties defined within the app.rb
file. These can be modified to perform test validation against your own Collective endpoint using your supplied Shared Secret.
ENDPOINT = 'https://example.widencollective.com/login/simple'
SHARED_SECRET = rand(36**8).to_s(36)