Dear All,
I am trying to enable OAuth2 using Kong. I am using
this project as a starting point. I am able to proceed till the point where I have to get the "code" parameter and the redirect uri.
But when I issue the POST request to get the access from the "code" I get the following response:
<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
<hr><center>openresty/1.11.2.1</center>
</body>
</html> The Request that I send is:
curl -X POST http://localhost:8443/oauth2/token \
-H "Host: test.com" \
-d "grant_type=authorization_code" \
-d "client_id=b0d67fbce15c411cad85bb9b764b534a" \
-d "client_secret=e2e9ba5e38444affb8398ca2014ca869" \
-d "redirect_uri=http://getkong.org/" \
-d "code=ea64b6a5958e423f8e98592eaf48ab7c" --insecure I checked online for this issue and it seems to indicate this might be due to some ill-configured conf file. I am also attaching that. I am currently using 0.9.8 version of Kong and Ubuntu 14.04.
Please Help.
Thanks
Vaibhav