TheNetworg/oauth2-azure

Overload the AccessToken jsonSerialize()

NPellet opened this issue · 1 comments

While recreating the access token from a stored session, I discovered that the claims are stored in the overloaded AccessToken ID (protected $idToken)
Now, the base class provides the jsonSerialize() method which I've been using to store the token in a session and id_token is empty while recreating the token.

I think jsonSerialize() should be overloaded to export id_token in the associative array.

Thoughts ?

I personally just stored this into $_SESSION and PHP did the serialization of the entire object for me. I don't think this would break anything so feel free to submit a Pull Request.