Hi @tyf thanks for responding. We have an integration partner who is leveraging the JWT bearer flow for authentication to their api. We need to generate a JWT and pass it to them and they will respond with a bearer token we can use to make subsequent calls. They have some specific requirements for the JWT, one being that the scope attribute needs to be an array rather than a string. We were hoping to use Auth0’s M2M solution rather than generating and signing our own JWTs. Would it be possible to use a client credentials hook to change the datatype of the scope attribute to an array?
Thanks for describing the use case, very helpful - I’m curious if there is any way for the consuming service to accept a value other than scope? My thinking is that you could write an Action for the client credentials exchange that would add a custom claim with the value of event.transaction.requested_scopes of the event object which will provide you with an array of the scopes requested. You would need to request the scopes explicitly in the request to /oauth/token, and they must be granted to the m2m at the API level in Auth0.