I get the following error using Camel Spring DSL
2018-11-05 23:15:59ERRORError running Integration flow IntgOneLoginGetAccessToken_AzureAD2018-11-05 23:15:59ERRORError Variable: errors: org.apache.camel.http.common.HttpOperationFailedExceptionMessage:
HTTP operation failed invoking https://login.microsoftonline.com/{{Tenant ID}}/oauth2/v2.0/token with statusCode: 400
INTEGRATION_FLOW
2018-11-05 23:15:59ERRORorg.apache.camel.http.common.HttpOperationFailedExceptionMessage:
This is the php code from Postman.
<?php$request = new HttpRequest();
$request->setUrl('https://login.microsoftonline.com/dc91a4f8-7b3f-4192b/oauth2/v2.0/token');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'Postman-Token' => '156803b1-d102-42fd-b6f5-4c0f0edcc70b',
'cache-control' => 'no-cache',
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
));
$request->setBody('------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Dis name="grant_type"
client_credentials
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Dis name="scope"
https://graph.microsoft.com/.default
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Dis name="client_id"
40264a72-840-a3d79349209b
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Dis name="client_secret"
wcixfXmBVDS5683$
------WebKitFormBoundary7MA4YWxkTrZu0gW--');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
Can you please assist?
*Learning--Forgetting--Learning*