无法通过 XMPPFramework 在 Jabberd 中注册新用户帐户
Cannot register a new user account in Jabberd by XMPPFramework
我在 IOS.
中尝试了一些使用 XMPPFrameWork 的新用户注册代码
(void)xmppStream:(XMPPStream *)sender didNotRegister:(NSXMLElement *)
error{
NSLog(@"Sorry the registration is failed");
NSLog(@"error: %@", error);
}
这是错误跟踪:
XmppDemo[314:26961] Did not authenticate 2015-12-03 08:54:30.331
XmppDemo[314:26961] Sorry the registration is failed 2015-12-03 08:54:30.332
XmppDemo[314:26961] error: <iq xmlns="jabber:client" from="azlnx001" type="error">
<query xmlns="jabber:iq:register">
<username>26</username>
<password>123</password>
</quer??y>
<error code="403" type="auth">
<forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"></forbidden>
</error>
</iq>
相关:
(void)xmppStream:(XMPPStream *)sender didNotAuthenticate:
(NSXMLElement *)error; {
NSLog(@"Did not authenticate"); NSError * err = nil;
if ( [self.xmppStream supportsInBandRegistration])
{ if(![self.xmppStream registerWithPassword:@"123" error:&err])
{ NSLog(@"Error registering: %@", err); }
}
}
谁能帮帮我?
可能未启用用户注册。如果您愿意,可以启用 mod_register
,如 ejabberd 文档中所述:http://docs.ejabberd.im/admin/guide/configuration/#modregister
请注意,它可能会带来垃圾邮件风险,因为它将自动创建帐户。
ejabberd.yml
##
## Only clients in the server machine can register accounts
##
ip_access: trusted_network
什么是trusted_network?我不知道配置 trusted_network,所以我禁用它:
##
## Only clients in the server machine can register accounts
##
## ip_access: trusted_network
我的应用可以注册新用户。很好。
我在 IOS.
中尝试了一些使用 XMPPFrameWork 的新用户注册代码(void)xmppStream:(XMPPStream *)sender didNotRegister:(NSXMLElement *)
error{
NSLog(@"Sorry the registration is failed");
NSLog(@"error: %@", error);
}
这是错误跟踪:
XmppDemo[314:26961] Did not authenticate 2015-12-03 08:54:30.331
XmppDemo[314:26961] Sorry the registration is failed 2015-12-03 08:54:30.332
XmppDemo[314:26961] error: <iq xmlns="jabber:client" from="azlnx001" type="error">
<query xmlns="jabber:iq:register">
<username>26</username>
<password>123</password>
</quer??y>
<error code="403" type="auth">
<forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"></forbidden>
</error>
</iq>
相关:
(void)xmppStream:(XMPPStream *)sender didNotAuthenticate:
(NSXMLElement *)error; {
NSLog(@"Did not authenticate"); NSError * err = nil;
if ( [self.xmppStream supportsInBandRegistration])
{ if(![self.xmppStream registerWithPassword:@"123" error:&err])
{ NSLog(@"Error registering: %@", err); }
}
}
谁能帮帮我?
可能未启用用户注册。如果您愿意,可以启用 mod_register
,如 ejabberd 文档中所述:http://docs.ejabberd.im/admin/guide/configuration/#modregister
请注意,它可能会带来垃圾邮件风险,因为它将自动创建帐户。
ejabberd.yml
##
## Only clients in the server machine can register accounts
##
ip_access: trusted_network
什么是trusted_network?我不知道配置 trusted_network,所以我禁用它:
##
## Only clients in the server machine can register accounts
##
## ip_access: trusted_network
我的应用可以注册新用户。很好。