Sravani ch
Sravani ch

Reputation: 11

Why am I getting "XMPPError: forbidden - auth [Access denied by service policy]" when registering a new user in ejabberd(23.10) using Smack(4.5)?

Problem Description:

I am trying to register a new user on an ejabberd server (23.0) hosted on an AWS instance using the Smack library (4.5). However, the registration fails with the following error:

XMPP error reply received from xxx.myejabberserver.com: XMPPError: forbidden - auth [Access denied by service policy]  

Server-Side Logs:

Here are the relevant logs from the ejabberd server:

2024-11-22 12:34:56.789 [info] <0.543.0>@ejabberd_listener:accept:363 (#Port<0.1234>) Accepted connection 198.51.100.45:12345 -> 203.0.113.20:5222
2024-11-22 12:34:56.890 [info] <0.543.0> Processing incoming stanza:
<iq type='set' id='reg1' to='xxx.myejabberserver.com'>
  <query xmlns='jabber:iq:register'>
    <username>user102</username>
    <password>Abc@1234</password>
  </query>
</iq>

2024-11-22 12:34:56.891 [debug] <0.543.0> Checking ACL: 'register' for IP: 198.51.100.45
2024-11-22 12:34:56.891 [debug] <0.543.0> ACL 'register' matched: deny

2024-11-22 12:34:56.892 [info] <0.543.0> Outgoing stanza:
<iq type='error' id='reg1' to='198.51.100.45'>
  <error type='auth'>
    <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
    <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Access denied by service policy</text>
  </error>
</iq>

#iq{id = <<"U94W7-7">>,type = error,lang = <<"en-US">>, ...}
<text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Access denied by service policy</text>

Configuration Details:

These are the relevant parts of my ejabberd.yml configuration:

mod_register:
  access_from: "0.0.0.0"
  ip_access: "0.0.0.0"

acl:
  admin:
    user:
      - "[email protected]"
  local:
    user_regexp: ""

access_rules:
  register:
    allow: all
allow_registration_ips:
  allow: all

What I Have Tried:

Upvotes: 1

Views: 17

Answers (1)

Badlop
Badlop

Reputation: 4120

mod_register:
  access_from: "0.0.0.0"
  ip_access: "0.0.0.0"

What documentation or tutorial did you read that recommends that configuration?

If you read the module documentation, those options do not accept such values.

Upvotes: 1

Related Questions