Reputation: 473
I am making a request to my auth server using the example from cypress documentation below.
Following is my configuration but I am getting a 400 bad request. The url should take me to the login form and authorise the user and then redirect to call back page to get the token.
Am i missing something?
const options = {
method: 'POST',
url: 'https://fakeauthserver.net/Account/Login',
qs: {
redirect_uri: 'http://localhost:9000/login/callback',
client_id: 'webapp',
response_type: 'code',
scope: 'full-access'
},
form: true,
body: {
Username: '[email protected]',
Password: '123456',
button: 'login'
}
};
_.extend(config);
cy.request(config)
Upvotes: 0
Views: 7745
Reputation: 1410
Usually, the 400 Bad Request
error occurs when you have made an error in the parameters sent in the request. Check whether you have sent all the parameters and whether they are the same as the ones registered in your identity provider.
Also, it might be due to POST
request you have made here. According to the OAuth specification, authorization request should be a GET
request.
Upvotes: 2