Rod Simpson created USERGRID-20:
-----------------------------------

             Summary: management/token response invalid json with unescaped 
double quotes
                 Key: USERGRID-20
                 URL: https://issues.apache.org/jira/browse/USERGRID-20
             Project: Usergrid
          Issue Type: Bug
          Components: Stack
            Reporter: Rod Simpson


"When I requested an org level access token, I got back a response that is not 
entirely valid JSON. The user data contains unescaped double quotes in the 
value of htmldisplayEmailAddress. (e.g. ""htmldisplayEmailAddress"": 
""[email protected] &lt;<a 
href=""[email protected]"">[email protected]</a>&gt;""). In general I 
would expect any response values to be escaped. 

I can still get the access token, but it's inconvenient to hack out the invalid 
JSON or regex extract the token. 

Request: 
https://api.usergrid.com/management/token 
{ 
""client_id"": ""b3U6mdJ8fG8-EeKo-wLoGuZA3A"", 
""client_secret"": ""b3U6QFHI9XmAb6URjWIWyeQ4hL0rUp4"", 
""grant_type"": ""client_credentials"" 
} 

Response data: 
{ 
""access_token"": 
""YWMtDt5kJqFPEeK6oQLoGuZA3AAAAT4UaCW40v5miNZPHHkIG-q1_whQuxloPb0"", 
""expires_in"": 3600, 
""organization"": { 
""users"": { 
""user"": { 
""applicationId"": ""00000000-0000-0000-0000-000000000001"", 
""username"": ""usern"", 
""name"": ""user"", 
""email"": ""[email protected]"", 
""activated"": true, 
""disabled"": false, 
""properties"": { 
""activated"": true, 
""confirmed"": true, 
""disabled"": false, 
""email"": ""[email protected]"", 
""name"": ""user"", 
""username"": ""user"" 
}, 
""uuid"": ""3e2fb4e2-e32e-11e1-8bdf-12313d1ca11d"", 
""adminUser"": true, 
""displayEmailAddress"": ""user <[email protected]>"", 
""htmldisplayEmailAddress"": ""user &lt;<a href=""mailto: 
[email protected]"">[email protected]</a>&gt;"" 
}, 
""selenium"": { 
""applicationId"": ""00000000-0000-0000-0000-000000000001"", 
""username"": ""selenium"", 
""name"": ""selenium"", 
""email"": ""[email protected]"", 
""activated"": true, 
""disabled"": false, 
""properties"": { 
""activated"": true, 
""confirmed"": true, 
""disabled"": false, 
""email"": ""[email protected]"", 
""name"": ""selenium"", 
""username"": ""selenium"" 
}, 
""uuid"": ""b6aaac0a-6f3e-11e2-a8fb-02e81ae640dc"", 
""adminUser"": true, 
""displayEmailAddress"": ""selenium <[email protected]>"", 
""htmldisplayEmailAddress"": ""selenium &lt;<a href=""mailto: 
[email protected]"">[email protected]</a>&gt;"" 
}, 
""[email protected]"": { 
""applicationId"": ""00000000-0000-0000-0000-000000000001"", 
""username"": ""[email protected]"", 
""name"": ""[email protected]"", 
""email"": ""[email protected]"", 
""activated"": false, 
""disabled"": false, 
""properties"": { 
""activated"": false, 
""confirmed"": false, 
""disabled"": false, 
""email"": ""[email protected]"", 
""name"": ""[email protected]"", 
""username"": ""[email protected]"" 
}, 
""uuid"": ""e84014f9-6f40-11e2-a8fb-02e81ae640dc"", 
""adminUser"": true, 
""displayEmailAddress"": ""[email protected] <[email protected]>"", 
""htmldisplayEmailAddress"": ""[email protected] &lt;<a href=""mailto: 
[email protected]"">[email protected]</a>&gt;"" 
} 
}, 
""name"": ""something"", 
""applications"": { 
""something/test2"": ""8ffacc48-9bda-11e2-9593-02e81adcf3d0"", 
""something/test"": ""97d00b30-6f40-11e2-81cf-02e81ac5a17b"" 
}, 
""uuid"": ""99d27c7c-6f3e-11e2-a8fb-02e81ae640dc"" 
} 
}"



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to