I think the token’s aud is targeted to a specific value, doesn’t seems the callback is sending the OAuth parameter which on my case required to identify the API resource ID. I tried to use Fiddler to get the response token but it didn’t capture any 401 response.
Any idea how can i get the token response using httprequest as I thought of decoding the token using jwt.io to check the aud value. I’d attempted to send a post request to the token URL but got an error which is due to content-type header value application/x-www-form-urlencoded.
{
“nodes”: [
{
“parameters”: {
“requestMethod”: “POST”,
“url”: “http://----fconfigsvc/spfauthentication/oauth/connect/token”,
“allowUnauthorizedCerts”: true,
“responseFormat”: “string”,
“options”: {},
“bodyParametersUi”: {
“parameter”: [
{
“name”: “resource”,
“value”: “EE9C5479-A52E-4D11-80AE-BFDDCE9A603F”
},
{
“name”: “scope”,
“value”: “ingr.api”
},
{
“name”: “client_id”,
“value”: “----1fclient-postman”
},
{
“name”: “client_secret”,
“value”: “—fsecret”
},
{
“name”: “grant_type”,
“value”: “password”
},
{
“name”: “username”,
“value”: “superuser”
},
{
“name”: “password”,
“value”: “1”
}
]
},
“headerParametersUi”: {
“parameter”: [
{
“name”: “Accept”,
“value”: “application/json,application/vnd.intergraph.data+json”
},
{
“name”: “content-type”,
“value”: “application/x-www-form-urlencoded”
}
]
}
},
“name”: “HTTP Request”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 1,
“position”: [
930,
330
]
}
],
“connections”: {}
}
ERROR: str.replace is not a function
TypeError: str.replace is not a function
at Querystring.rfc3986 (/usr/local/lib/node_modules/n8n/node_modules/request/lib/querystring.js:43:14)
at Request.json (/usr/local/lib/node_modules/n8n/node_modules/request/request.js:1287:30)
at Request.init (/usr/local/lib/node_modules/n8n/node_modules/request/request.js:406:10)
at Request.RP$initInterceptor [as init] (/usr/local/lib/node_modules/n8n/node_modules/request-promise-core/configure/request2.js:45:29)
at new Request (/usr/local/lib/node_modules/n8n/node_modules/request/request.js:127:8)
at Object.request (/usr/local/lib/node_modules/n8n/node_modules/request/index.js:53:10)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest.node.js:752:51)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/src/Workflow.js:583:37)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:369:62
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:447:15
Without the content-type value it returned ERROR 415 - Unsupported Media Type which indicates content-type is required.