1

I build a FB app which does the following:

1) redirect initial request to FB, in order to authenticate/login, as follows:

https://www.facebook.com/dialog/oauth?client_id=MYAPPID&redirect_uri=http://localhost:8080/FB/servlet&scope=read_stream&response_type=code

2) in servlet, get the "code" parameter (which is the signed_request?):

 String signedReq = request.getParameter("code");

// the String retrieved from the code parameter is:
// 3DaDJXq1Mlsq67GbeudlUxu7bY5Um4hSJlwzoPCHhp4.eyJpdiI6Ikc1ODNuRjZXbnhCb0hUV1FEMVNTQUEifQ._iXKxSGiNHfc-i5fRO35ny6hZ03DcLwu4bpAkslqoZk6OfxW5Uo36HwhUH2Gwm2byPh5rVp2kKCNS6EoPEZJzsqdhZ_MhuUD8WGky1dx5J-qNOUqQK9uNM4HG4ziSgFaAV8mzMGeUeRo8KSL0tcKuq

3) How to get the OAuth token from this String?

Thanks in advance! M

1

1 Answer 1

5

On the facebook docs it tells you to send it back to facebook:

http://developers.facebook.com/docs/authentication/

Basically you do this:

   https://graph.facebook.com/oauth/access_token?
   client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&
   client_secret=YOUR_APP_SECRET&code=THE_CODE_FROM_ABOVE

This should work for you normally.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.