Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServerTokenStoreImpl does not publish refresh token events to cluster #102

Closed
longirun opened this issue May 15, 2020 · 1 comment
Closed
Assignees
Labels
type: bug Something isn't working ver: 7.2.2 ver: 7.3.0 Fixed in version
Milestone

Comments

@longirun
Copy link

Environment

  • Platform version: all 6.xx to 7.xx
  • Addon version: all

Description of the bug or enhancement

Methods
public void removeRefreshToken(String refreshTokenValue); public void storeRefreshToken(String refreshTokenValue, byte[] refreshTokenBytes, byte[] authenticationBytes, Date tokenExpiry, String userLogin);
does not make call
clusterManagerAPI.send(new TokenStoreRemoveRefreshTokenMsg(refreshTokenValue));
like it removeAccessToken and storeAccessToken do. Therefore resulting in unsync between different servers in a cluster.

@longirun
Copy link
Author

longirun commented May 15, 2020

Here is the fix in our project.

/**
 * Should be removed once ticket is fixed:
 * https://github.com/cuba-platform/restapi/issues/102
*/
@Deprecated
public class EgisTokenStoreBean extends ServerTokenStoreImpl {

    @Override
    public void removeRefreshToken(String refreshTokenValue) {
        super.removeRefreshToken(refreshTokenValue);

        clusterManagerAPI.send(new TokenStoreRemoveRefreshTokenMsg(refreshTokenValue));
    }

    @Override
    public void storeRefreshToken(String refreshTokenValue, byte[] refreshTokenBytes, byte[] authenticationBytes, Date tokenExpiry, String userLogin) {
        super.storeRefreshToken(refreshTokenValue, refreshTokenBytes, authenticationBytes, tokenExpiry, userLogin);

        clusterManagerAPI.send(new TokenStoreAddRefreshTokenMsg(refreshTokenValue, refreshTokenBytes, authenticationBytes, tokenExpiry, userLogin, null));
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working ver: 7.2.2 ver: 7.3.0 Fixed in version
Projects
None yet
Development

No branches or pull requests

4 participants