I’m trying to authenticate Unity clients, created using fabric.io.
So far, I have tested on iOS. The client is very simple. It performs a login and outputs the values for TwitterSession.authToken.token and TwitterSession.authToken.secret.
However, when I try to do a “basic” REST request on the server, it fails to authenticate. This is how I’m testing server side authentication from the command line:
curl --request 'POST' 'https://api.twitter.com/oauth2/token' --header 'Authorization: Basic '$(echo [TOKEN]:[SECRET] | base64) --header 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8' --data "grant_type=client_credentials" --verbose
- with [TOKEN]:[SECRET] replaced with the values from the Unity client running on iOS
I always get this response:
{"errors":[{"code":99,"message":"Unable to verify your credentials","label":"authenticity_token_error"}]}
Has anyone got any ideas?