1

I am trying to configure oauth in ejabberd 16.01. I managed to get the "/oauth/authorize_token" page, but as I fill the data in the form and click on "Accept" button it reloads the page with error "This page isn't working. ERR_EMPTY_RESPONSE".

ejjaberd oauth error page

I have tried to follow the official documentation. Here is my ejabberd.yml file https://www.dropbox.com/s/wy2ng2kq404jbfw/ejabberd.yml?dl=0

I have following questions:

  1. What am I doing wrong here?
  2. How to create client id for oauth?
  3. What goes in the field "server" of "/oauth/authorize_token" page?
Vikas Roy
  • 13
  • 2
  • 8

1 Answers1

0
  1. What am I doing wrong here?

You are not giving correct values in web page. Eg. if your user is admin@test.com and password is password then it can be mapped like this

User -> admin , Server -> test.com and Password -> password

  1. How to create client id for oauth?

Please go through page at https://docs.ejabberd.im/admin/guide/oauth/

3.What goes in the field "server" of "/oauth/authorize_token" page?

Already answered in 1

Girdhar Sojitra
  • 648
  • 4
  • 14
  • As per you suggestion, I am passing the correct values. Response is still the same. The guide does not say anything about how to create client_id. It just says "client_id: This is the name of the application that is asking for Oauth token." – Vikas Roy Apr 08 '17 at 04:43
  • you don't need to generate client_id.Pass any value for it and it should work. – Girdhar Sojitra Apr 08 '17 at 04:49
  • commands_admin_access: configure commands: - add_commands: - user oauth_expire: 3600 oauth_access: all...This is a global configuration.It is not part of port config. – Girdhar Sojitra Apr 08 '17 at 04:52
  • Tried it. Doesn't work. Do I need to enable any specific module for this? – Vikas Roy Apr 08 '17 at 05:18
  • can you share debug level logs of ejabberd server ? – Girdhar Sojitra Apr 08 '17 at 05:24
  • When I hit the "accept" button. It says: 2017-04-08 05:35:10.625 [error] <0.640.0> CRASH REPORT Process <0.640.0> with 0 neighbours crashed with reason: call to undefined function oauth2:authorize_password({<<"admin">>,<<"globalgarner.com">>}, <<"admin">>, <<"http://localhost/chat/index.php">>, [<<"get_roster">>], {password,<<"******">>}) – Vikas Roy Apr 08 '17 at 05:43
  • It seems that you have not built/install ejabberd correctly because this error says that oauth module/dependency is missing.Dependency name is p1_oauth2. Please make sure it is installed. – Girdhar Sojitra Apr 08 '17 at 06:01
  • I installed the missing package separately[sudo apt-get install erlang-oauth2] and it seems to work now. Now I have a different problem: https://stackoverflow.com/questions/43350010/400-bad-request-error-while-calling-ejabberd-api – Vikas Roy Apr 11 '17 at 15:22