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

Make DecodedJWT serializable #366

Closed
skjolber opened this issue Nov 25, 2019 · 5 comments
Closed

Make DecodedJWT serializable #366

skjolber opened this issue Nov 25, 2019 · 5 comments

Comments

@skjolber
Copy link
Contributor

Description

I was about to pass the DecodedJWT to a subclass of the Serializable Spring Authentication (via AbstractAuthenticationToken), but then noticed it is not serializable.

Making DecodedJWT implement serializable would be helpful.

Reproduction

The storage field must be marked as transient to pass code quality checks.

Environment

Latest version.

@jimmyjames
Copy link
Contributor

Hi @skjolber, I think this is a reasonable request and use case; we will look into adding serialization support to DecodedJWT.

@jimmyjames
Copy link
Contributor

@skjolber Serialization added in PR #370. I verified it is able to serialize it as a field in a Spring Authentication subclass, but if you'd like to try and verify as well please feel free to. We'll target getting this merged next week unless you have feedback sooner. Thanks!

@skjolber
Copy link
Contributor Author

@jimmyjames thanks, the PR looks good to me.

@jimmyjames
Copy link
Contributor

Fixed by #370, available in version 3.9.0.

@JorisHeadease
Copy link

Hi all,

Thanks a lot for this fix @jimmyjames!

I was wondering if it's possible to mark the DecodedJWT itself as serializable as such:
public interface DecodedJWT extends Payload, Header, Serializable

This would be nice as the DecodedJWT is the public facing entity being scanned by code quality systems (SonarQube in our case). I still get the following warning on version 3.10.1: "Make "jwt" transient or serializable." Other than that, I feel a DecodedJWT should always be serializable, even if more classes implement the interface.

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants