Authentication with JWT ServiceAccount for M2M-communication

For M2M-communication with an API I want to connect to I have to implement a JWT-based authentication. This seems to be OAuth2 compatible and RFC7521 compliant.
In the documentation of the API can be found an example, but I don’t know yet how to implement this in n8n.

Does anyone have an idea?

Thanks a lot!

Hi @mokkin, looks like they use OIDC (OpenID Connect) which is indeed built on top of OAuth2. The urn:ietf:params:oauth:grant-type:jwt-bearer grant type they are using here is, however, not supported by n8n’s generic OAuth2 credentials from the looks of it and is only used in a handful of node-specific credentials instead with custom code generating the jwt signature.

So for the time being you’d have to build the logic required by this service manually and then send the required HTTP Requests.

I’ll also convert this question into a feature request so you and other users can vote on having this implemented in the future :slight_smile:

Thanks again for your answer!

It’s a pity that it isn’t supported yet by n8n but I understand that this method seems to be very rare.

Are those node-specific credentials like for Salesforce or Google a good starting point? Can you recommend professionals developing this feature?

Hi @mokkin, these credentials can be a good starting point if you’re thinking about developing a custom implementation for your Dionera credentials (which you could then select as its own credentials type) .

This might, however, not be needed as I think the signature described in the docs could also be generated using n8n’s existing Code node so no custom version of n8n might be needed. But since there isn’t a free self-service account on that page I couldn’t verify this first hand.

As for professional assistance with building your workflow (or custom credentials), there’s a few n8n experts active here on the forum. You could post in the Jobs category if you’d like to reach out or have us match you with a suitable expert by filling out the “Find an n8n expert” form at n8n experts.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.