|
MediaWiki master
|
This is a hook handler interface, see docs/Hooks.md. More...
Inherited by MediaWiki\HookContainer\HookRunner.
Public Member Functions | |
| onGetSessionJwtData (?UserIdentity $user, array &$jwtData) | |
| Called when a JWT session token is created, can modify the information stored within. | |
This is a hook handler interface, see docs/Hooks.md.
Use the hook name "GetSessionJwtData" to register handlers implementing this interface.
Definition at line 15 of file GetSessionJwtDataHook.php.
| MediaWiki\Hook\GetSessionJwtDataHook::onGetSessionJwtData | ( | ?UserIdentity | $user, |
| array & | $jwtData ) |
Called when a JWT session token is created, can modify the information stored within.
JWT tokens are used to authenticate requests for some session types. The details depend on the session type.
Might be called both when the JWT is created (for mutable sessions during SessionProvider::persistSession(); for immutable sessions, where session tokens are created out-of-band, in the business logic of some API / special page / etc), and when the JWT is verified (during SessionProvider::provideSessionInfo() and maybe refreshSessionInfo()).
Note that session verification happens before the user is autocreated, so you should not rely on $session->getUser()->isAnon() and similar.
| UserIdentity | null | $user | The user who is the subject of the claim. Guaranteed to not be an IP user. Null if the session is anonymous. |
| array | &$jwtData | A set of JWT claims that the hook can alter or expand. Claim values are JSON-compatible data structures (ie. scalar values or array structures where the leafs are scalar values). |
Implemented in MediaWiki\HookContainer\HookRunner.