Background:
Facebook Documentation: Access Tokens
Using the like above you can see Facebook's documentation for the process I am trying to accomplish.
That is, I have server API's that have already successfully authenticated and linked to a Facebook user's account and I have a long term token on our servers. Using the long term token (via server side) I am trying to generate a "client code" (as Facebook calls it) in order to send down to one of our iOS client apps. Which the client app can then use to create a long term token of it's on in order to use the SDK locally.
Steps Taken:
- Documentation states that three values need to be passed in: access_token, client_secret, redirect_uri (client_secret being the application secret). This is already wrong as when only passing these values, Graph API states that client_id (otherwise known as application id) is required.
- Passing all four values:
- access_token: long term token
- client_id: facebook application identifier
- client_secret: facebook application secret
- redirect_uri: facebook application redirect uri used when created long term session token
Issue:
I get the following error message returned:
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1
}
Questions:
- How do I find out what exactly the "error" that is being encountered?
- Is there something that I am doing wrong to generate this client code?
The "issue" was there was a bug with Facebook's code. Bug was reported, fixed and now working with no issues.