Lambda - Augment JWT with client_credentials/M2M flow
-
Hi,
We've recently started exploring the migration from Auth0 to FusionAuth, and I was wondering if there's a way to read the body of a request using a Lambda. In Auth0, the equivalent would be an Action with the onExecuteCredentialsExchange, which includes the event parameter that allows us to access the request body.
I noticed that the client credentials Lambda structure in FusionAuth has four arguments: jwt, recipientEntity, targetEntities, and permissions. However, we need to augment the JWT claims with a value passed in the body of the client credentials grant request.
Is there a way to achieve this?
Thanks!
-
It sounds like you would like to be able to read
state
or similar in a lambda (we don't currently allow this)In a populate lambda, you do have access to
- Entity Data (https://fusionauth.io/docs/apis/entities/entities) (
entity.data
)
This means that you can set any custom field you would like on your entity and use that in a populate worklfow - .fetch() https://fusionauth.io/docs/extend/code/lambdas/#using-lambda-http-connect
So you could access custom data attributes or call out to another system in the lambda
If you have access to a support contract, you can also log a support ticket if you would like or open a feature request outlining your requirements
https://fusionauth.io/docs/operate/troubleshooting/technical-support - Entity Data (https://fusionauth.io/docs/apis/entities/entities) (