title: Creating new user with Smack 4.2.0-beta1 on ejabberd throws XMPP Exception: forbidden - auth
body: <p>I am doing Chat application with smack . I am new for this technology.</p>
  
  <p>I have created some manual users from Ejabberd server. Using those users I have done one to one chat and group chat.</p>
  
  <p>But I tried to create new user from android code 
  But I am getting this below error</p>
  
  <pre><code> XMPPError: forbidden - auth
      08-02 08:23:36.273 31097-31097/com.agarangroup.hello W/System.err:     at org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:232)
      08-02 08:23:36.273 31097-31097/com.agarangroup.hello W/System.err:     at org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:207)
  </code></pre>
  
  <p>This is the configuration I have in ejabberd server</p>
  
  <pre><code>announce    [{allow,[{acl,admin}]}]
  c2s [{deny,[{acl,blocked}]},{allow,[{acl,all}]}]
  c2s_shaper  [{none,[{acl,admin}]},{normal,[all]}]
  configure   [{allow,[{acl,admin}]}]
  local   [{allow,[{acl,all}]}]
  max_user_offline_messages   [{5000,[{acl,admin}]},{100,[all]}]
  max_user_sessions   [{10,[all]}]
  muc_create  [{allow,[{acl,all}]}]
  pubsub_createnode   [{allow,[{acl,local}]}]
  register    [{allow,[{acl,all}]}]
  s2s_shaper  [{fast,[all]}]
  trusted_network [{allow,[{acl,loopback}]}]
  </code></pre>
  
  <p><strong>Updated :</strong> </p>
  
  <p><strong>Here I am initialising my connection</strong></p>
  
  <pre><code> private void initialiseConnection() {
          DomainBareJid serviceName = null;
          try {
              serviceName = JidCreate.domainBareFrom(ServiceAddress);
          } catch (XmppStringprepException e) {
              e.printStackTrace();
          }
          XMPPTCPConnectionConfiguration.Builder config = XMPPTCPConnectionConfiguration
                  .builder().setKeystoreType(null);
          // XMPPTCPConnectionConfiguration.builder().setKeystoreType(null);
  
          config.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
          config.setServiceName(serviceName);
          config.setHost(serverAddress);
          config.setPort(5222);
          config.setDebuggerEnabled(true);
          XMPPTCPConnection.setUseStreamManagementDefault(true);
          connection = new XMPPTCPConnection(config.build());
          XMPPConnectionListener connectionListener = new XMPPConnectionListener();
          connection.addConnectionListener(connectionListener);
      }
  </code></pre>
  
  <p><strong>I am connection this connection after initialise</strong></p>
  
  <pre><code> connection.connect();
                      DeliveryReceiptManager dm = DeliveryReceiptManager
                              .getInstanceFor(connection);
                      dm.setAutoReceiptMode(AutoReceiptMode.always);
                      dm.addReceiptReceivedListener(new ReceiptReceivedListener() {
                          @Override
                          public void onReceiptReceived(Jid fromJid, Jid toJid, String receiptId, Stanza receipt) {
  
                          }
                      });
                      connected = true;
  </code></pre>
  
  <p><strong>Method to create new user</strong></p>
  
  <pre><code>public void createNewUser(){
          try {
             /* UserRegisterUtil.registerAccount(connection,"Mathan","mathan@4792");
              connection.disconnect();
              connection.connect();*/
             Localpart lp = Localpart.from("IamHere");
              // Registering the user
              AccountManager accountManager = AccountManager.getInstance(connection);
              accountManager.sensitiveOperationOverInsecureConnection(true);
              accountManager.createAccount(lp, "mathan123"); // Skipping optional fields like email, first name, last name, etc..
              Toast.makeText(context, "=&gt;User creation completed....",
                      Toast.LENGTH_LONG).show();
              Log.d("xmpp", "&gt;User creation completed....!");
          } catch (SmackException.NoResponseException e) {
              e.printStackTrace();
          } catch (XMPPException.XMPPErrorException e) {
              e.printStackTrace();
          } catch (NotConnectedException e) {
              e.printStackTrace();
          } catch (InterruptedException e) {
              e.printStackTrace();
          } catch (XMPPException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          } catch (SmackException e) {
              e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>It's an error I got It says Denied by ACL. But I don't know how to change  it in windows ejabberd server.</p>
  
  <pre><code>  &lt;error code='403' type='auth'&gt;&lt;forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/&gt;&lt;text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'&gt;Denied by ACL&lt;/text&gt;&lt;/error&gt; 
  </code></pre>
  
  <p><strong>Can anyone tell me how to create a new user, What I wanna change in this configuration file?</strong></p>
  
  <p>Also I have some doubt</p>
  
  <p><strong>How to get offline messages in android using smack library?</strong></p>
  
  <p><strong>How to get chat history?</strong></p>