symfony/mercure

Add namespacing support on claims

Closed this issue · 0 comments

Hello,

The aim being to allow the use of Mercure with access tokens generated by Auth0.

https://auth0.com/docs/tokens/guides/create-namespaced-custom-claims
By default, Auth0 always enforces namespacing; any custom claims with non-namespaced identifiers will be silently excluded from tokens.

Here is an example of Auth0 rule :

function` (user, context, callback) {
 var namespace = 'https://example.com/';
 context.accessToken[namespace + 'mercure'] = { "subscribe": [ user.email ] };
 return callback(null, user, context);
}

Thanks for your feedback guys and cheers
cc @dunglas