The issue is that the M2M token endpoint conforms to OAuth2-expected field names, which meant they didn't match our existing names from a StytchError -- since an end-user wouldn't particularly care about this difference when using the backend SDK, this PR simply converts the field names from the OAuth2 names to our StytchError names.
Testing
I created a simple script locally to create an M2M client and then try to get a token using a bogus client_secret.
Excerpt below:
Fixes #314
The issue is that the M2M token endpoint conforms to OAuth2-expected field names, which meant they didn't match our existing names from a StytchError -- since an end-user wouldn't particularly care about this difference when using the backend SDK, this PR simply converts the field names from the OAuth2 names to our StytchError names.
Testing
I created a simple script locally to create an M2M client and then try to get a token using a bogus client_secret. Excerpt below: