I had a problem trying to execute a web request in UGC and authenticate with oAuth. I am making a web request, for example:
WebRequest wr = WebRequest.Create("http://ugc.service/odata.svc/Ratings(Id=200)");
wr.Headers["authorization"] = "OAuth " + auth;
Where auth is my token returned from access_token.svc. According to the documentation, the token returned from the service should look something like this: -
HufXeuUt% 2FYYElA8SYjJOkUkrXxV9dyXRirmKhjW% 2Fb% 2FU% 3D
However, what I return from access_token.svc is more like: -
{"access_token": "client_id% 3dtestuser% 26expiresOn% 3d1361898714646% 26digest% 3d% 2fW% 2fvyhQneZHrm1aGhwOlgLtA9xGWd77hkxWbjmindtM% 3d", "expires_in": 300}
I parsed JSON to extract various lines and tried to pass authorization to them, but all I try is getting an error in the logs - "ERROR Error OAuth2AccessToken - Digest Invalid". What part of the token and in what format should I go through authorization?
Many thanks
John
source
share