omniauth / omniauth-saml

A generic SAML strategy for OmniAuth
https://github.com/omniauth/omniauth-saml
Other
331 stars 205 forks source link

redirect does not appear to work #6

Closed joeldsa closed 11 years ago

joeldsa commented 12 years ago

Hi,

I'm trying to debug why the redirect does not work and the saml flow does not begin. I'm not able to find what is missing in my code. Can you help me? This is what I have. What am I getting wrong?

require 'sinatra' require 'omniauth-saml'

use Rack::Session::Cookie use OmniAuth::Strategies::SAML, :assertion_consumer_service_url => "http://idp.local.com:3000/auth/saml/callback", :issuer => "https://idp.local.com/shibboleth-sp", :idp_sso_target_url => "https://openidp.org/idp/profile/SAML2/Redirect/SSO", :idp_cert_fingerprint => "63:49:58:C9:59:57:A5:09:13:DA:62:FE:14:2C:1B:93:A8:3C:6D:B7", :name_identifier_format => "urn:oasis:names:tc:SAML:2.0:nameid-format:transient"

class SAMLLoginApplication < Sinatra::Base

get '/' do "Hello World #{SecureRandom.uuid}" end

Support both GET and POST for callbacks

%w(get post).each do |method| send(method, "/auth/:provider/callback") do env['omniauth.auth'] # => OmniAuth::AuthHash end end

configure :development do $logger = Logger.new(STDOUT) OmniAuth.config.logger = $logger end

end

rajiv commented 11 years ago

if you are trying to setup SP-initiated SSO, issue a GET to /auth/saml, not /auth/saml/callback. this detail is now documented in the README.

please try omniauth-saml 1.0.0 and refile if still not working.