Smack icon indicating copy to clipboard operation
Smack copied to clipboard

Token-based reconnection implementation

Open ramabit opened this issue 8 years ago • 9 comments

Docs: http://www.xmpp.org/extensions/inbox/token-reconnection.html

Login with token: xmppConnection.login(token, resourcepart);

Get tokens: TBRManager tbrManager = TBRManager.getInstanceFor(xmppConnection); TBRTokens tbrTokens = tbrManager.getTokens(); String accessToken = tbrTokens.getAccessToken(); String refreshToken = tbrTokens.getRefreshToken();

Get last refresh token obtained from "success" nonza: String refreshToken = xmppConnection.getXOAUTHLastRefreshToken();

To avoid reconnection using token: xmppConnection.avoidTokenReconnection();

ramabit avatar Jul 12 '16 17:07 ramabit

@Flowdalic Take a look at this :) I have a question: how could I retrieve a refresh token from a "success" Nonza after authenticating? Because the actual Smack's authentication workflow doesn't allow me to do that I believe.

ramabit avatar Jul 12 '16 17:07 ramabit

Hi @ramabit. Thanks for your contribution, but I'm sorry I'm not going to review or accept a PR that is full of non semantic changes. Please fix this.

Flowdalic avatar Jul 12 '16 17:07 Flowdalic

@Flowdalic I understand, but the the automatic checks won't pass :/ should I ignore it?

ramabit avatar Jul 12 '16 18:07 ramabit

@Flowdalic I understand, but the the automatic checks won't pass :/ should I ignore it?

I don't understand. You mean if you don't introduce non-semantic changes, then gradle check will fail? Every commit in master passes gradle check. If you base your work on master and don't introduce new checkstyle violations, then gradle check will succeed.

Flowdalic avatar Jul 12 '16 18:07 Flowdalic

@Flowdalic Yes, you are right. But I can't use Command+Shift+F shortcut, and that makes not to introduce new checkstyle violations difficult and painful. But well, I will try

ramabit avatar Jul 12 '16 18:07 ramabit

Most formatters have a setting to only format your own code (i.e. the code you just added or modified). Which is what you usually always want. People, especially in FOSS projects, don't like to review commits with tons of unrelated non-semantic whitespaces changes. They just distract from the real changes.

Flowdalic avatar Jul 12 '16 18:07 Flowdalic

@Flowdalic is now ok? Should I squash the commits?

ramabit avatar Jul 12 '16 20:07 ramabit

@Flowdalic ^ I am testing a way to retrieve the refresh token :)

ramabit avatar Jul 12 '16 21:07 ramabit

@Flowdalic Fixes added and the problem retrieving the refresh token is solved

ramabit avatar Jul 13 '16 15:07 ramabit