I just started working Kong, I am trying to add oauth2 for my service.
I have followed the steps in Doc.
When I request for access token, I am getting bellow error.
{“message”:“no route and no API found with those values”}
Am I Missing anything. Please help me to address the issue
Service Reg:
curl -X POST http://:8001/services/
–data “name=service1”
–data “url=http:///”
Route Creation:
====================================
curl -i -X POST
–url http://:8001/services/service1/routes
–data ‘hosts[]=’
–data ‘paths[]=/v1/api/orders’
–data ‘methods[]=GET’
Adding Plugin for service1:
curl -X POST http://:8001/services/service1/plugins
–data “name=oauth2”
–data “config.scopes=read”
–data “config.mandatory_scope=true”
–data “config.token_expiration=7200”
–data “config.enable_client_credentials=true”
–data “config.global_credentials=true”
Consumer Reg:
==============================
curl -X POST http://<Kong IP>:8001/consumers --data "username=test@gmail.com" --data "custom_id=1032"
Binding Consumer:
curl -X POST http://<Kong IP>:8001/consumers/test@gmail.com/oauth2 \
--data "name=clientapp1" \
--data "client_id=TEST_CLIENT" \
--data "client_secret=TEST_SECRET" \
--data "redirect_uri=http:/<Service IP>//"
Access Token Request:
curl -X POST -k https://localhost:8443/v1/api/orders/oauth2/token/ \
--data "client_id=TEST_CLIENT" \
--data "client_secret=TEST_SECRET" \
--data "grant_type=client_credentials" \
--data "provision_key=vVvHL0V8qTlyzGNlZqJ7M8oUW5rVKpIG" \
--data "authenticated_userid=test@gmail.com" \
--data "scope=read"