dlindahl / omniauth-cas

A CAS OmniAuth Strategy
MIT License
88 stars 79 forks source link

"Two configuration options" followed by three configuration options #18

Closed brchristian closed 10 years ago

brchristian commented 10 years ago

The documentation says: OmniAuth CAS requires at least one of the following two configuration options: and then lists three configuration options: url, host, and login_url. I'm confused. What does this mean?

brchristian commented 10 years ago

Also, for what it's worth, I only filled in url and was instantly hit with the exception :host and :login_url MUST be provided, which doesn't quite jive with the guide, which says Optional if using url!

samrocketman commented 10 years ago

You'll have to be more specific. How did you "fill in" your options? Give an exact excerpt with personal information removed.

brchristian commented 10 years ago

Hmm, I've been tweaking the config files a lot so I'm not certain which triggered the exception, but I suspect I was doing something like

 CASConfig = YAML::load(File.open("#{Rails.root.to_s}/config/cas.yml"))

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :cas, url: CASConfig['server']
end
samrocketman commented 10 years ago

As long as CASConfig['server'] is a string which is of the format: https://yourserver.com with no trailing slashes (not sure if that matters or not). As you can see in configuration.rb where default values are derived from the url. You must provide a login_url: else have it default to /login as specified here. I don't believe your login_url may be null (see ref) but that would only happen if you purposefully set it to be that way.

Just a thought from some light digging.

dlindahl commented 10 years ago

@brchristian That was a poorly worded line. Probably a copy/paste error.

I have corrected the README in 6f3f1b6f51c3aa2b510efeb46e8772410c1a8e2c