Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi,
is it possible to use the integration runtime SAP oData connector to authenticate via a token?
The process will be as followed:
1. Request with username/password to endpoint "GetToken"
2. Response is body with json values where I get my access token
3. Use the access token to authenticate to SAP
There is something for CSRF token requests. But I am not sure if this is the same thing. Right now my settings are this:
Authentication type: Fixed
Auth. Server ID: -empty-
Rel. URL for CSRF Get Request: /v1/auth/.../token
CSRF Token Name: acc_token
HTTP Connector Connection Settings:
Username & Password for token endpoint
Base URL, rel. URL as needed for SAP...
It worked for my endpoint where no authentication is required. But for this one I've only get a 401 - Unauthorized.
Solved! Go to Solution.
Hello,
if I understand you correctly you want to fetch a current token and use it (as ApiKey?) to authenticate yourself to SAP.
If so you can override the service "GetCustomHeaderParameters" on your thing and handle the logic in it and return a matching infotable containing the apikey as result:
// TODO: fetch Key/Token
// e.g. const tokenResponse = Resources["ContentLoaderFunctions"].GetJSON(params);
var result = { dataShape: { fieldDefinitions: {} }, rows: [] };
result.dataShape.fieldDefinitions["header"] = {
name: "apikey",
baseType: "STRING"
};
result.rows = [{ "apikey": tokenResponse.token }];
Hello,
if I understand you correctly you want to fetch a current token and use it (as ApiKey?) to authenticate yourself to SAP.
If so you can override the service "GetCustomHeaderParameters" on your thing and handle the logic in it and return a matching infotable containing the apikey as result:
// TODO: fetch Key/Token
// e.g. const tokenResponse = Resources["ContentLoaderFunctions"].GetJSON(params);
var result = { dataShape: { fieldDefinitions: {} }, rows: [] };
result.dataShape.fieldDefinitions["header"] = {
name: "apikey",
baseType: "STRING"
};
result.rows = [{ "apikey": tokenResponse.token }];