added Token Based Reconnection and tested everything #758
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@chrisballinger I implemented
Token Based Reconnection
. DON'T MERGE YETHere is the documentation:
http://mongooseim.readthedocs.io/en/latest/open-extensions/token-reconnection/
http://www.xmpp.org/extensions/inbox/token-reconnection.html
There is something I can't find a way of implementing it, maybe you can give a clue:
When authenticating using TBR you send:
There are two types of tokens, the
Access token
that never changes and theRefresh Token
that is refreshed every time you send it to the server, so after sending the<auth>
with aRefresh Token
the server will respond the following:And I need a way of being able to get that
new_refresh_token
. The different ways I found of doing this are:id <XMPPSASLAuthentication> auth;
from XMPPStream public (just the getter) and store thenew_refresh_token
in the auth (XMPPTBRAuthentication
) so I can do somethign like this in thexmppStreamDidAuthenticate
:XMPPStream.h
something like:And call that method from
- (void)handleAuth:(NSXMLElement *)authResponse
inXMPPStream.m
checking ifauth
is from typeXMPPTBRAuthentication
and grab thenew_refresh_token
from theauthResponse
What do you think???