TheNetworg / oauth2-azure

Azure AD provider for the OAuth 2.0 Client.
https://packagist.org/packages/thenetworg/oauth2-azure
MIT License
230 stars 108 forks source link

Overload the AccessToken jsonSerialize() #131

Closed NPellet closed 2 years ago

NPellet commented 3 years ago

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 ?

hajekj commented 3 years ago

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.