>it looks like the response contains a www-authenticate header that we
don't handle at this moment:
I mean : the value of the header is not supported, as it seems it does not
comply with RFC rules.

Best regards,
Thierry Boileau

Hello Mutaz,
>
> it looks like the response contains a www-authenticate header that we
> don't handle at this moment:
> WWW-Authenticate: OAuth "Facebook Platform" "invalid_token" "Invalid OAuth
> access token."
>
> The specification of oauth (http://oauth.net/core/1.0/#rfc.section.5.4)
> indicates that:
> This section defines an [RFC2617] 
> <http://oauth.net/core/1.0/#RFC2617>extension to support OAuth. It uses the 
> standard HTTP
> Authorization and WWW-Authenticate headers to pass OAuth Protocol
> Parameters.
> According to the RFC 2617, the WWW-authenticate looks like:
>
>   auth-scheme    = token
>   auth-param     = token "=" ( token | quoted-string )
>   challenge   = auth-scheme 1*SP 1#auth-param
>   WWW-Authenticate  = "WWW-Authenticate" ":" 1#challenge
>
>
> I'm not convinced the header value follows this rule. But, it seems that
> the interpretation is quite restrictive, we may relax the parsing logic in
> order to not stop the process.
>
> Best regards,
> Thierry Boileau
>
>
>
>
> I have the following code
>>
>>
>>                String openGraphUri = "https://graph.facebook.com/";;
>>                String accessToken = "gerkjh43kj5h43kjh34k";
>>                ClientResource clientResource = new
>> ClientResource(openGraphUri + "me/feed" + "?access_token=" + accessToken);
>>                Form form = new Form();
>>                form.add("message", "test message");
>>                Representation resp = clientResource.post(form);
>>
>> When I run it I get the below exception. You can try the code without any
>> change because the access token provided above is invalid so the code will
>> throw the same exception (Bad Request 400)
>>
>>
>>
>>
>> java.io.IOException: Parameter or extension has no name. Please check your
>> value
>>        at
>>
>> org.restlet.engine.http.header.HeaderReader.readParameter(HeaderReader.java:425)
>>        at
>>
>> org.restlet.engine.http.header.ChallengeRequestReader.readValue(ChallengeRequestReader.java:128)
>>        at
>>
>> org.restlet.engine.http.header.ChallengeRequestReader.readValue(ChallengeRequestReader.java:46)
>>        at
>>
>> org.restlet.engine.http.header.HeaderReader.addValues(HeaderReader.java:243)
>>        at
>>
>> org.restlet.engine.http.header.HeaderReader.readValues(HeaderReader.java:605)
>>        at
>>
>> org.restlet.engine.security.AuthenticatorUtils.parseRequest(AuthenticatorUtils.java:378)
>>        at
>>
>> org.restlet.engine.http.header.HeaderUtils.copyResponseTransportHeaders(HeaderUtils.java:814)
>>        at
>>
>> org.restlet.engine.http.connector.ClientConnection.copyResponseTransportHeaders(ClientConnection.java:152)
>>        at
>>
>> org.restlet.engine.http.connector.ClientConnection.readMessage(ClientConnection.java:269)
>>        at
>>
>> org.restlet.engine.http.connector.Connection.readMessages(Connection.java:673)
>>        at
>> org.restlet.engine.http.connector.Controller$2.run(Controller.java:95)
>>        at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>        at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>        at java.lang.Thread.run(Thread.java:680)
>> Exception in thread "main" Bad Request (400) - Bad Request
>>        at
>> org.restlet.resource.ClientResource.handle(ClientResource.java:867)
>>        at
>> org.restlet.resource.ClientResource.post(ClientResource.java:1206)
>>        at
>> org.restlet.resource.ClientResource.post(ClientResource.java:1152)
>>        at
>> com.zeedna.applications.social.facebook.resources.Test.main(Test.java:21)
>>
>>
>> Thank you
>> Mutaz
>>
>> --
>> View this message in context:
>> http://restlet-discuss.1400322.n2.nabble.com/Bad-Request-exception-bug-tp7431921p7431921.html
>> Sent from the Restlet Discuss mailing list archive at Nabble.com.
>>
>> ------------------------------------------------------
>>
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2943865
>>
>
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2945319

Reply via email to