Download Free Trial

How to set authorization in the request of webApi


Hello! In our application we use webApi, where in all requests we need to pass a token in the Authorization attribute of the request. I wonder if there is a way to pass this tribute
Exemple of request with authorization header 

type: "GET",
url: "localhost:8001/Controller/Method",
headers: {
'Authorization': 'limited ' + limitedGuid,
'Accept-Language': 'pt-BR;q=0.6,pt;q=0.4'
dataType: "json"
.success(function(data) { })

But in FlexMonster I can only pass the url

cubeOptions.dataSource = {
dataSourceType: "ocsv",
/* URL to the Data Compressor .NET */
filename: "localhost:8001/Cube/GetCube?cubeId=1"


1 answer

Tanya Gryshko Flexmonster November 1, 2017

Hello, Cleyton,
Thank you for writing on our support forum.
It is not possible to pass an authorization header in Flexmonster. We recommend specifying all the necessary parameters via filename property. For example, you have already specified cubeId=1 in your URL. Authorization and Accept-Language may be passed here as well. Then you can parse these parameters on the server side and use them. The security of using this approach is the same as for authorization headers.
Please let me know if the above approach is helpful.

Please login or Register to Submit Answer