0
こんにちは私はxmppフレームワークで作業しています。私は私がやっている何をログ私のconnectメソッドでiosでxmppストリームを認証する方法
SEND: <?xml version='1.0'?>
2016-04-14 11:27:54:712 [1731:1807] SEND: <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' to='172-31-21-148'>
2016-04-14 11:35:08:592 [1731:650f] RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="172-31-21-148" id="58xfmkolyf" stream1:lang="en" version="1.0"/>
2016-04-14 11:35:08:593 [1731:520f] RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>SCRAM-SHA-1</mechanism><mechanism>CRAM-MD5</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth"/><register xmlns="http://jabber.org/features/iq-register"/></stream:features>
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>SCRAM-SHA-1</mechanism><mechanism>CRAM-MD5</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth"/><register xmlns="http://jabber.org/features/iq-register"/></stream:features>
<auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="SCRAM-SHA-1">biwsbj05NTczNjM1MjY0LHI9MUMzNjhCODktMjZGNi00NjJFLUJBQTAtNDFCNDA5OEYzMDE4</auth>
2016-04-14 11:41:42:545 [1731:622f] RECV: <presence xmlns="jabber:client" to="ip-172-31-21-148/58xfmkolyf" type="error"><x xmlns="vcard-temp:x:update"><photo/></x><error code="401" type="auth"><not-authorized xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></presence>
2016-04-14 11:41:43:177 [1731:622f] RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>
2016-04-14 11:41:47:547 [1731:607] SEND: <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="SCRAM-SHA-1">biwsbj05NTczNjM1MjY0LHI9REMzRkY3RDQtNEYxNy00RkVBLUE1OTktMjA3QTE5REJGQTNE</auth>
2016-04-14 11:41:47:860 [1731:180b] RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>
の下に取得していていのログインながら
- (BOOL)connect
{
if (![xmppStream isDisconnected]) {
return YES;
}
myJID =[NSString stringWithFormat:@"%@@172-31-21-148",[[NSUserDefaults standardUserDefaults] stringForKey:@"userNameJID"]];
NSString *myPassword [email protected]"123456";
// If you don't want to use the Settings view to set the JID,
// uncomment the section below to hard code a JID and password.
//
// myJID = @"[email protected]/xmppframework";
// myPassword = @"";
if (myJID == nil || password1 == nil) {
return NO;
}
[xmppStream setMyJID:[XMPPJID jidWithString:myJID]];
password = myPassword;
NSError *error = nil;
if (![xmppStream connectWithTimeout:XMPPStreamTimeoutNone error:&error])
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error connecting"
message:@"See console for error details."
delegate:nil
cancelButtonTitle:NSLocalizedString(@"O_K", @"OK")
otherButtonTitles:nil];
[alertView show];
DDLogError(@"Error connecting: %@", error);
return NO;
}
return YES;
}
しかし、私のストリームJIDそれは「のように表示されて送信中です172- 31-21-148 "しかしusername @ servernameのようにする必要があります。私が行方不明ですどこ私は