The following section describes how you can create your own Plugin which will be invoked to return user claims

Apex callable

You need to create an Apex which implements the standard Salesforce Callable interface and which handles an action get:claims.
The action handler receives the following parameters
user_id : Id : The Id of the user for whom the claims are requested.
claims : String[] : The name of the claims requested about the user.
The action must return a Map<String, Object> which contains all the claims requested. All keys which are not part of the input claims: String[] will be ignored.
MyClaimCallable.cls
1global class MyClaimCallable implements Callable {
2 global Object call(String action, Map<String, Object> args) {
3 if (action == 'get:claims') {
4 User u = [SELECT Email, Custom_Field__c FROM User WHERE Id =: (Id) args.get('user_id') ];
5 return new Map<String, Object> {
6 'sub' => u.Email,
7 'custom_field' => u.Custom_Field__c
8 };
9 }
10 return null;
11 }
12}