XMPP 常见错误:<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>
2016-08-17 22:21
483 查看
一般登陆/注册 出错,会在认证失败这里打印出error信息
其实,XMPP认证的问题,一般都是与JID有关的,因此解决这类问题,首选的入口就是分析一下XMPPStream的JID,客户端在与服务器连接后,Socket就绑定了这个端口,用来处理与服务器的往返数据,认证就是其中之一.而且,往往我们在与服务器来连接的时候,为了简便,经常使用localhost或者127.0.0.1来当做域名的部分,这时候要尤其注意,因为使用Spark或者其他客户端程序登录的时候,使用这样的域名登录服务器是没有问题的,但在代码中处理就要特别小心,一定要在服务器的后段,确认域名统一:
在spark中登陆是使用127.0.0.1登陆时可以登陆,但是在代码中设置,openfire的域名地址时要填写正确,不能使用127.0.0.1
否则就会出现上述错误.而openfire的服务器IP地址也就是我们本地服务器的IP地址,(电脑的IP地址)
在浏览器中输入 localhost:9090 可以查看本地服务器的域名
//openfire服务器IP地址
#define kHostName @"172.16.12.178" // 本机的ip地址
//openfire服务器端口默认5222
#define kHostPort 5222
//openfire域名
#define kDomin @"hnxyzhw.local"
//resource
#define kResource @"iOS"
- (void)xmppStream:(XMPPStream *)sender didNotAuthenticate:(DDXMLElement *)error
<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>
其实,XMPP认证的问题,一般都是与JID有关的,因此解决这类问题,首选的入口就是分析一下XMPPStream的JID,客户端在与服务器连接后,Socket就绑定了这个端口,用来处理与服务器的往返数据,认证就是其中之一.而且,往往我们在与服务器来连接的时候,为了简便,经常使用localhost或者127.0.0.1来当做域名的部分,这时候要尤其注意,因为使用Spark或者其他客户端程序登录的时候,使用这样的域名登录服务器是没有问题的,但在代码中处理就要特别小心,一定要在服务器的后段,确认域名统一:
在spark中登陆是使用127.0.0.1登陆时可以登陆,但是在代码中设置,openfire的域名地址时要填写正确,不能使用127.0.0.1
否则就会出现上述错误.而openfire的服务器IP地址也就是我们本地服务器的IP地址,(电脑的IP地址)
在浏览器中输入 localhost:9090 可以查看本地服务器的域名
//openfire服务器IP地址
#define kHostName @"172.16.12.178" // 本机的ip地址
//openfire服务器端口默认5222
#define kHostPort 5222
//openfire域名
#define kDomin @"hnxyzhw.local"
//resource
#define kResource @"iOS"
相关文章推荐
- XMPP 常见错误:(<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>)
- iOS XMPP之常见错误一:(<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>)
- XMPP 常见错误一:(<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>)
- iOS XMPP之常见错误一:(<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>)
- Libjingle XMPP Login登录返回<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/>异常分析
- 解决<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized></not-authorized></failure>
- resin启动报错:guava-15.0.jar!/META-INF/beans.xml:5: <beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"> is an unexpected top-level tag. 异常
- resin启动报错:guava-15.0.jar!/META-INF/beans.xml:5: <beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"> is an unexpec
- resin启动报错:guava-15.0.jar!/META-INF/beans.xml:5: <beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"> is an unexpec
- 关于"XML 文档(2, 2)中有错误:不应有 <xml xmlns=''>"错误
- hibernate 注解配置<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/X
- 错误:The MagicAjax HttpModule is not included in web.config. Add [<httpModules><add name="MagicAjax" type="MagicAjax.Magic
- "ASIHTTPRequest"使用报错:ARC forbids explicit...及#import <libxml/HTMLparser.h> file not found
- 关于"XML 文档(2, 2)中有错误:不应有 <xml xmlns=''>"错误
- 关于xml配置文件无元素提示和the root element of the document is not <xsd:schema>.错误
- WCF常见错误之HTTP could not register URL http://+:80/Temporary_Listen_Addresses/<guid>/ because TCP port 80 is being used by
- weblogic部署异常: cvc-enumeration-valid: string value '3.0' is not a valid enumeration value for web-app-versionType in namespace http://java.sun.com/xml/ns/javaee:<null>
- [C# | XML] XML 反序列化解析错误:<xml xmlns=''> was not expected. 附通用XML到类解析方法
- 关于"XML 文档(2, 2)中有错误:不应有 <xml xmlns=''>"错误