-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OmniAuth initializer does not pass configuration? #5
Comments
Thank you for your comment. If you still use the older version, please try the latest 1.0.8. If you use the latest one, I am sorry that I could not reproduce the problem in my environment... In compensation, I just create a simple test application: https://github.com/toyokazu/omniauth-shibboleth-testapp If possible, could you test omniauth-shibboleth with that application? It includes Gemfile.lock The following are the outputs in my environment. at /session_viewer
config/initializers/omniauth.rb provider :shibboleth, {:uid_field => 'uid',
:info_fields => {:email => 'mail'},
:extra_fields => [:"unscoped-affiliation", :entitlement],
# :debug => true
} It seems fine... If you find the problem in omniauth-shibboleth, please let me know. Best Regards |
In the beginning I was using I will check the testcase (probably next week though) and keep you posted. |
I modified your testapp to use It was only when I began suspecting Devise and wanted to set up your testapp to use Devise, when I noticed that Devise initializer takes a configuration in the form: config.omniauth :shibboleth In the Devise Omniauth Facebook example doc I noticed that I can pass in other configuration too. So the correct place to specify the configuration for omniauth-shibboleth is in config.omniauth :shibboleth, {:uid_field => 'eppn',
:info_fields => {:email => 'mail', :name => 'cn', :last_name => 'sn'},
:extra_fields => [:schacHomeOrganization]
} And There is one weird thing though - I did think that maybe the Is it possible that omniauth initializer is read before (or executed before) Devise initializes Omniauth configuration and in my case Devise overrode some of the options, but not all of them (namely the debug). Anyhow, the issue is resolved now. Thank you for your testapp. |
Thank you very much for your detail investigation! Since I am not an expert of devise, currently I do not know the solution of your problem...;( So thus, I would like to add a description in README about devise integration. When I found some solution, I would like to update it. Anyway, thank you for your contribution :) |
I think that this is documentation issue on the For I would also move the notice right after the Setup Shibboleth Strategy block, so it is visible at the right moment. |
Filed issue at heartcombo/devise/issues/2128 |
Thank you for your comment and I am sorry to be late reply. Best Regards |
The omniauth initializer:
Shibboleth strategy does see the
eppn
attribute and set it touid
- I can use that.Also, logging
request.env
shows that all the wanted fields are present.But for some reason it does not set rest of the configured fields.
If I hardcode these into the gemfile
lib/omniauth/strategies/shibboleth.rb
:It starts working.
So there is some glitch in how OmniAuth passes options to Shibboleth strategy.
The text was updated successfully, but these errors were encountered: