Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Cannot Reproduce
-
None
-
None
-
None
Description
I tried to execute POST request to shindig/gadgets/metadata. It does
work for java version, but it doesn't work for php.
Here is a curl command
curl -i -X POST -H "Accept: application/json" -H "Content-Type:
application/json"
-d
'{"context":
,"gadgets":[
{"url":"http://hosting.gmodules.com/ig/gadgets/file/108085167802252611023/wikipedia.xml", "moduleId":0}]}'
http://shindig/gadgets/metadata
The output is:
{"gadgets":[
]}
If I supply a token ?st=1:1:1:1:1:1:1, it works
It seems as the problem is in BasicSecurityToken.php.
public function isAnonymous()
{ return ($this->tokenData[$this->OWNER_KEY] === SecurityToken::$ANONYMOUS) && ($this->tokenData[$this->VIEWER_KEY] === SecurityToken::$ANONYMOUS); }...
public function getOwnerId() {
if ($this->isAnonymous())
return $this->tokenData[$this->OWNER_KEY];
}
In java version there is different implementation.
public boolean isAnonymous()
{ return false; }...
public String getOwnerId()
Should we remove isAnonymous check from BasicSecurityToken.php?
Or it should be done on a higher level, and if the token is anonymous
the functions of BasicSecurityToken shouldn't be called at all?