Open marcello opened 9 years ago
I had this issue recently trying to configure my gitlab with my university's cas server.
The problem was with
service_validate_url: '/cas/serviceValidade'
Apparently its not validating the ticket with the server. When parsing the results, it returns Nil and breaks when it tries to merge nil result with the "fetch_raw" from other sources.
try using removing 'cas'
service_validate_url: '/serviceValidade'
Ok but same error. I tried check the ticket with URL browser and it works. Do you have another ideia?
You could try to print the xml response body. Make sure that the CAS server is responding with fail or success. There should be a response somewhat like this:
<?xml version="1.0"?>
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>123123123</cas:user>
</cas:authenticationSuccess>
</cas:serviceResponse>
If you don't get a response like this, raw_data will be set to NIL and then you get the undefined merge for NIL. My CAS server is using JSAIG, i need to validate my ticket with /samlValidate. Unfortunately this cas implementation still doesn't support that :(
I no longer have access to a CAS server and therefore am no longer fit to maintain this project.
If you would like to volunteer to be a maintainer of this project, please let me know by opening an Issue.
---- Infos ---- $ gem list|grep omniauth omniauth (1.2.2) omniauth-cas (1.1.0) omniauth-shibboleth (1.2.1)
---- Configs ---- RAILS_APP/config/initializers/omniauth.rb Rails.application.config.middleware.use OmniAuth::Builder do provider :cas, url: 'https://ufgnet.ufg.br/cas', disable_ssl_verification: true, service_validate_url: '/cas/serviceValidade' end
---- Log Error ---- Started GET "/auth/cas/callback?url&ticket=ST-104523-pQP0pOvmEzChiNdYuomg-cas.ufg.br" for 200.137.222.222 at 2015-08-21 09:17:46 -0300
NoMethodError - undefined method'
merge' for nil:NilClass: omniauth-cas (1.1.0) lib/omniauth/strategies/cas.rb:194:in
fetch_raw_info' omniauth-cas (1.1.0) lib/omniauth/strategies/cas.rb:84:incallback_phase' omniauth (1.2.2) lib/omniauth/strategy.rb:227:in
callback_call' omniauth (1.2.2) lib/omniauth/strategy.rb:184:incall!' omniauth (1.2.2) lib/omniauth/strategy.rb:164:in
call' omniauth (1.2.2) lib/omniauth/builder.rb:59:incall' meta_request (0.3.4) lib/meta_request/middlewares/app_request_handler.rb:13:in
call' meta_request (0.3.4) lib/meta_request/middlewares/meta_request_handler.rb:13:incall' warden (1.2.3) lib/warden/manager.rb:35:in
block in call' warden (1.2.3) lib/warden/manager.rb:34:incall' rack (1.5.5) lib/rack/etag.rb:23:in
call' rack (1.5.5) lib/rack/conditionalget.rb:25:incall' rack (1.5.5) lib/rack/head.rb:11:in
call' actionpack (4.1.12) lib/action_dispatch/middleware/params_parser.rb:27:incall' actionpack (4.1.12) lib/action_dispatch/middleware/flash.rb:254:in
call' rack (1.5.5) lib/rack/session/abstract/id.rb:225:incontext' rack (1.5.5) lib/rack/session/abstract/id.rb:220:in
call' actionpack (4.1.12) lib/action_dispatch/middleware/cookies.rb:562:incall' activerecord (4.1.12) lib/active_record/query_cache.rb:36:in
call' activerecord (4.1.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:incall' activerecord (4.1.12) lib/active_record/migration.rb:380:in
call' actionpack (4.1.12) lib/action_dispatch/middleware/callbacks.rb:29:inblock in call' activesupport (4.1.12) lib/active_support/callbacks.rb:82:in
run_callbacks' actionpack (4.1.12) lib/action_dispatch/middleware/callbacks.rb:27:incall' actionpack (4.1.12) lib/action_dispatch/middleware/reloader.rb:73:in
call' actionpack (4.1.12) lib/action_dispatch/middleware/remote_ip.rb:76:incall' better_errors (1.1.0) lib/better_errors/middleware.rb:84:in
protected_app_call' better_errors (1.1.0) lib/better_errors/middleware.rb:79:inbetter_errors_call' better_errors (1.1.0) lib/better_errors/middleware.rb:56:in
call' rack-contrib (1.4.0) lib/rack/contrib/response_headers.rb:17:incall' meta_request (0.3.4) lib/meta_request/middlewares/headers.rb:16:in
call' actionpack (4.1.12) lib/action_dispatch/middleware/debug_exceptions.rb:17:incall' actionpack (4.1.12) lib/action_dispatch/middleware/show_exceptions.rb:30:in
call' railties (4.1.12) lib/rails/rack/logger.rb:38:incall_app' railties (4.1.12) lib/rails/rack/logger.rb:20:in
block in call' activesupport (4.1.12) lib/active_support/tagged_logging.rb:68:inblock in tagged' activesupport (4.1.12) lib/active_support/tagged_logging.rb:26:in
tagged' activesupport (4.1.12) lib/active_support/tagged_logging.rb:68:intagged' railties (4.1.12) lib/rails/rack/logger.rb:20:in
call' actionpack (4.1.12) lib/action_dispatch/middleware/request_id.rb:21:incall' rack (1.5.5) lib/rack/methodoverride.rb:21:in
call' rack (1.5.5) lib/rack/runtime.rb:17:incall' activesupport (4.1.12) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in
call' rack (1.5.5) lib/rack/lock.rb:17:incall' actionpack (4.1.12) lib/action_dispatch/middleware/static.rb:84:in
call' rack (1.5.5) lib/rack/sendfile.rb:112:incall' railties (4.1.12) lib/rails/engine.rb:514:in
call' railties (4.1.12) lib/rails/application.rb:144:incall' thin (1.6.3) lib/thin/connection.rb:86:in
block in pre_process' thin (1.6.3) lib/thin/connection.rb:84:inpre_process' thin (1.6.3) lib/thin/connection.rb:53:in
process' thin (1.6.3) lib/thin/connection.rb:39:inreceive_data' eventmachine (1.0.8) lib/eventmachine.rb:193:in
run' thin (1.6.3) lib/thin/backends/base.rb:73:instart' thin (1.6.3) lib/thin/server.rb:162:in
start' thin (1.6.3) lib/thin/controllers/controller.rb:87:instart' thin (1.6.3) lib/thin/runner.rb:200:in
run_command' thin (1.6.3) lib/thin/runner.rb:156:inrun!' thin (1.6.3) bin/thin:6:in
<top (required)>' /home/weby-teste/.rbenv/versions/2.1.2/bin/thin:23:in `