I'm trying to get a token from a given endpoint by using restsharp and client_credentials authenthication specifying a scope. The token I get in response does not have the correct scope and the I use it in fails (no sufficient right).
When I do the request via postman Oauth2 authenthication the token I get has the correct scope. PostmanRequest result. But when I do it like that :
var client = new RestClient(_tokenEndpoint);
var request = new RestRequest(Method.POST);
request.AddParameter("client_id", _clientId);
request.AddParameter("client_secret", _clientSecret);
request.AddParameter("grant_type", "client_credentials");
request.AddParameter("Scope", "rxpclient-arsenal-ms.write",ParameterType.GetOrPost);
IRestResponse<TokenResponse> response = client.Execute<TokenResponse>(request);
The response I get is Image of restSharp response
Am I doing anything wrong?
Turns out "scope" with no capital letter is the solution