BA
Better Auth•2mo ago
Walker

client_credentials flow for m2m auth?

Howdy! I'm enjoying using this library a lot! I'm hoping to use it to throw a POC together. I see in the OIDC provider docs that Client Credentials is supported. But, when I make the following req to my auth api:
curl --request POST \
--url http://localhost:5173/api/auth/oauth2/token \
--header 'Authorization: Basic bXlfY2xpZW50X2lkOm15X2NsaWVudF9zZWNyZXQ=' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials
curl --request POST \
--url http://localhost:5173/api/auth/oauth2/token \
--header 'Authorization: Basic bXlfY2xpZW50X2lkOm15X2NsaWVudF9zZWNyZXQ=' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials
I get the following response:
{
"error_description": "code is required",
"error": "invalid_request"
}
{
"error_description": "code is required",
"error": "invalid_request"
}
I've found an earlier thread (from March) that says y'all don't support m2m yet. Is that still true? Or have I just goofed on my usage/implementation?
1 Reply
Walker
WalkerOP•5w ago
If not, I wonder if there's a way I can extend the functionality of the oidc provider? 🤔

Did you find this page helpful?