[DLUX-22] Authentification header is not appended when using apidoc/apis when using Restangular in DLUX Created: 14/Apr/15  Updated: 22/Jun/15  Resolved: 22/Jun/15

Status: Resolved
Project: dlux
Component/s: General
Affects Version/s: unspecified
Fix Version/s: None

Type: Bug
Reporter: Juraj Sebin Assignee: Harman Singh
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: PC


Issue Links:
Blocks
blocks DLUX-26 DLUX YANGUI embedded apidocs needs AuthN Resolved
External issue ID: 2989

 Description   

When calling apidoc/apis with Restangular, the authentification token is not passed to header:
GET /apidoc/apis HTTP/1.1
Host: localhost:8181
Connection: keep-alive
Accept: application/json, text/plain, /
Origin: http://localhost:9000
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36
Referer: http://localhost:9000/index.html
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6

e.g. restconf/modules call header looks like this:
GET /restconf/modules HTTP/1.1
Host: localhost:8181
Connection: keep-alive
Accept: application/json, text/plain, /
Origin: http://localhost:9000
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36
Authorization: Basic YWRtaW46YWRtaW4=
Referer: http://localhost:9000/index.html
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6

Restangular used to call this APIs is defined as:
yangUtils.factory('YangUtilsRestangular', ['Restangular', 'ENV',
function (Restangular, ENV) {
var r = Restangular.withConfig(function(RestangularConfig)

{ RestangularConfig.setBaseUrl(ENV.getBaseURL("MD_SAL")); }

);

return r;
}]);

The calls are executed as:
YangUtilsRestangular.one('restconf').one('modules')... (for working restconf/modules API)
YangUtilsRestangular.one('apidoc').one('apis')... (for not working apidoc/apis API)



 Comments   
Comment by Juraj Sebin [ 14/Apr/15 ]

Forgot to mention - we are using nodejs server running via grunt and we are connecting to remote controller.

Comment by Harman Singh [ 15/Jun/15 ]

https://git.opendaylight.org/gerrit/#/c/22638/

Generated at Wed Feb 07 19:57:43 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.