Error at creating an OAuth2 Connection

Infos:

  • Used Zammad version: 2.4
  • Used Zammad installation source: package
  • Operating system: CentOS 7

Actual behavior:

  • I am trying to set up an OAuth Connection using the Client ID, Secret and both the …/oauth/authorize and …/oauth/authorize URLs. When requesting a token, I get an error 500.

Consol Output Rest Client

Event OAuth 2 Request 'Authorization'
GET http://support.ecomsilio.de/oauth/authorize?client_id=8c3ee01e622c5dd298173f98b62685df32xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&response_type=code&state=KGLyVRPxxxxxxxxxxxxxxxxRf26L1goJ


Event OAuth 2 Request 'Access Token'

POST http://support.ecomsilio.de/oauth/token
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
Accept: application/json, text/json, text/javascript, application/xml, text/xml, application/x-plist, application/x-www-form-urlencoded, text/plain, text/html, application/xhtml+xml, 
---Body---
refresh_token&client_id=8c3ee01e622c5dd298173f98b62685df32xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&client_secret=afc91d5ef8b344xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx438b37ccbaaf9545b8ef&grant_type=refresh_token

Error OAuth 2 Response 'Access Token' Request failed: not found (404)
HTTP 404
---Body---
{"error":"No route matches [GET] /oauth/token"}

Output client:

<!DOCTYPE html>
<html class="dark">
<meta charset="utf-8">
<title>500: Something went wrong</title>
<link rel="stylesheet" href="/assets/error/style.css">
<body <% if @traceback %>class="error-message"<% end %>>
<h1>500: We're sorry, but something went wrong.</h1>
<% if !@traceback %>
  <div class="error-image" style="background-image: url(/assets/error/error-2.svg)"></div>
  <p>We're sorry, but something went wrong.</p>
<% else %>
  <div><%= @exception.message %></div>
  <% if @exception.backtrace %>
    <pre><code>
<% @exception.backtrace.each {|row| %>
  <%= row %>
<% } %></code></pre>
  <% end %>
<% end %>
</body>
</html>

production.log

I, [2018-05-23T06:50:14.905542 #757]  INFO -- : Started POST "/api/v1/applications/token" for 85.10.241.97 at 2018-05-23 06:50:14 +0200
I, [2018-05-23T06:50:14.911870 #757]  INFO -- : Processing by ApplicationsController#token as JSON
I, [2018-05-23T06:50:14.911970 #757]  INFO -- :   Parameters: {"id"=>1}
I, [2018-05-23T06:50:14.934710 #757]  INFO -- : Completed 200 OK in 23ms (Views: 0.2ms | ActiveRecord: 7.0ms)
I, [2018-05-23T06:50:22.692771 #761]  INFO -- : 2018-05-23T06:50:22+0200: [Worker(host:localhost pid:761)] Job Observer::UserDeviceLogJob (id=733) RUNNING
I, [2018-05-23T06:50:22.720305 #761]  INFO -- : 2018-05-23T06:50:22+0200: [Worker(host:localhost pid:761)] Job Observer::UserDeviceLogJob (id=733) COMPLETED after$
I, [2018-05-23T06:50:23.519925 #761]  INFO -- : execute Channel.fetch (try_count 0)...
I, [2018-05-23T06:50:25.296573 #757]  INFO -- : Started GET "/oauth/token" for 85.10.241.97 at 2018-05-23 06:50:25 +0200
I, [2018-05-23T06:50:25.301207 #757]  INFO -- : Processing by ErrorsController#routing as JSON
I, [2018-05-23T06:50:25.301275 #757]  INFO -- :   Parameters: {"a"=>"oauth/token"}
E, [2018-05-23T06:50:25.301543 #757] ERROR -- : No route matches [GET] /oauth/token (ActionController::RoutingError)

I, [2018-05-23T06:50:25.303124 #757]  INFO -- : Completed 404 Not Found in 2ms (Views: 0.2ms | ActiveRecord: 0.3ms)
I, [2018-05-23T06:50:28.743267 #757]  INFO -- : Started GET "/oauth/authorize?client_id=8c3ee01e622c5dd298173f98b62685df32cf12a7df70a2d7e74779768cc161f7&response_$
I, [2018-05-23T06:50:28.747765 #757]  INFO -- : Processing by Doorkeeper::AuthorizationsController#new as HTML
I, [2018-05-23T06:50:28.747841 #757]  INFO -- :   Parameters: {"client_id"=>"8c3ee01e622c5dd298173f98b62685df32cf12a7df70a2d7e74779768cc161f7", "response_type"=>"$
I, [2018-05-23T06:50:29.343792 #757]  INFO -- : Completed 500 Internal Server Error in 596ms (ActiveRecord: 0.5ms)
F, [2018-05-23T06:50:29.344336 #757] FATAL -- :
F, [2018-05-23T06:50:29.625037 #757] FATAL -- : NameError (undefined local variable or method `new_user_session_url' for #<Doorkeeper::AuthorizationsController:0x$
F, [2018-05-23T06:50:29.625164 #757] FATAL -- :
F, [2018-05-23T06:50:29.625206 #757] FATAL -- : config/initializers/doorkeeper.rb:10:in `block (2 levels) in <top (required)>'
I, [2018-05-23T06:50:31.320517 #761]  INFO -- : Scheduler running...
I, [2018-05-23T06:50:31.327961 #761]  INFO -- : Running job thread for 'Process escalation tickets' (Ticket.process_escalation) status is: sleep
I, [2018-05-23T06:50:31.328180 #761]  INFO -- : Running job thread for 'Import OTRS diff load' (Import::OTRS.diff_worker) status is: sleep
I, [2018-05-23T06:50:31.328294 #761]  INFO -- : Running job thread for 'Generate Session data' (Sessions.jobs) status is: sleep
I, [2018-05-23T06:50:31.328340 #761]  INFO -- : Running job thread for 'Check streams for Channel' (Channel.stream) status is: sleep
I, [2018-05-23T06:50:31.328382 #761]  INFO -- : Running job thread for 'Check Channels' (Channel.fetch) status is: sleep
I, [2018-05-23T06:50:31.328815 #761]  INFO -- : Running job thread for 'Execute jobs' (Job.run) status is: sleep
I, [2018-05-23T06:50:31.329083 #761]  INFO -- : Started job thread for 'Generate user based stats.' (Stats.generate)...
I, [2018-05-23T06:50:31.333699 #761]  INFO -- : execute Stats.generate (try_count 0)...
I, [2018-05-23T06:50:31.513172 #761]  INFO -- :  ...stopped thread for 'Stats.generate'
I, [2018-05-23T06:50:31.838493 #761]  INFO -- : execute Ticket.process_escalation (try_count 0)...
I, [2018-05-23T06:50:53.529359 #761]  INFO -- : execute Channel.fetch (try_count 0)...
I, [2018-05-23T06:51:23.536618 #761]  INFO -- : execute Channel.fetch (try_count 0)...
I, [2018-05-23T06:51:26.500967 #761]  INFO -- : execute Import::OTRS.diff_worker (try_count 0)...
I, [2018-05-23T06:51:30.194962 #757]  INFO -- : Started POST "/" for 68.201.121.4 at 2018-05-23 06:51:30 +0200
F, [2018-05-23T06:51:30.198695 #757] FATAL -- :
F, [2018-05-23T06:51:30.198791 #757] FATAL -- : ActionController::RoutingError (No route matches [POST] "/"):
F, [2018-05-23T06:51:30.198833 #757] FATAL -- :
F, [2018-05-23T06:51:30.198877 #757] FATAL -- : vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/debug_exceptions.rb:63:in `call'
vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/rack/logger.rb:36:in `call_app'
vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/rack/logger.rb:24:in `block in call'
vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/tagged_logging.rb:69:in `block in tagged'
vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/tagged_logging.rb:26:in `tagged'
vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/tagged_logging.rb:69:in `tagged'
vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/rack/logger.rb:24:in `call'
vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/request_id.rb:25:in `call'
vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/method_override.rb:22:in `call'
vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/runtime.rb:22:in `call'
vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/executor.rb:12:in `call'
vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/static.rb:125:in `call'
vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/sendfile.rb:111:in `call'
vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:522:in `call'
vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/configuration.rb:225:in `call'
vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/server.rb:624:in `handle_request'
vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/server.rb:438:in `process_client'
vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/server.rb:302:in `block in run'
vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/thread_pool.rb:120:in `block in spawn_thread'
vendor/bundle/ruby/2.4.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
I, [2018-05-23T06:51:41.329740 #761]  INFO -- : Scheduler running...
I, [2018-05-23T06:51:41.338660 #761]  INFO -- : Running job thread for 'Process escalation tickets' (Ticket.process_escalation) status is: sleep
I, [2018-05-23T06:51:41.339008 #761]  INFO -- : Running job thread for 'Check Channels' (Channel.fetch) status is: sleep
I, [2018-05-23T06:51:41.339088 #761]  INFO -- : Running job thread for 'Import OTRS diff load' (Import::OTRS.diff_worker) status is: sleep
I, [2018-05-23T06:51:41.339256 #761]  INFO -- : Running job thread for 'Generate Session data' (Sessions.jobs) status is: sleep
I, [2018-05-23T06:51:41.339322 #761]  INFO -- : Running job thread for 'Check streams for Channel' (Channel.stream) status is: sleep
I, [2018-05-23T06:51:41.339819 #761]  INFO -- : Running job thread for 'Execute jobs' (Job.run) status is: sleep

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.