I'm trying to get an access token from my Identity Server 4 with client_credentials , i think i almost finished the Google pages with my search and i found nothing. So please:
This is my GetClients method
[![enter image description here][1]][1]My PostMan Request, in the header i have only the Content_Type
which is application/x-www-form-urlencoded
And the error :
You started with the correct row of code: "secret".Sha256()
but later forgot it.
Try the following:
var secret = new Secret {Value = "test".Sha512()};
ClientSecrets = new[] {secret};
The secret must be hashed.
Briefly tested with
curl https://localhost:5001/connect/token -d "grant_type=client_credentials&client_id=azure-client-id&client_secret=test"
and
curl https://localhost:5001/connect/token -H "Authorization: Basic YXp1cmUtY2xpZW50LWlkOnRlc3Q=" -d "grant_type=client_credentials"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With