I am new to Aqueduct and I am facing a invalid client error whenever I try to make a request to the /auth/token
or /auth/code
route.
I have already added the OAuth2.0 client and verified the secret is correct.
My request to /auth/token
looks like this:
Future main() async {
var http2 = new http.Client();
var clientID = "com.wildfire.mobile";
var clientSecret = "myspecialsecret ";
var body = "username=usr&password=pwd&grant_type=password";
var clientCredentials = new Base64Encoder().convert(
"$clientID:$clientSecret".codeUnits);
var response = await
http.post(
"http://localhost:8081/auth/token",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Basic $clientCredentials"
},
body: body);
And when I try logging in in /auth/code
with a username in the _user database the server throws a 400:invalid_client