Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example in combination with example scheme does not show how to use API calls without need for Facebook login #4

Open
Tails opened this issue Jul 9, 2015 · 5 comments
Assignees

Comments

@Tails
Copy link
Contributor

Tails commented Jul 9, 2015

When running the example locally, it is not possible to log in to Facebook, since the app does not seem to be registered for that kind of use. I suspect that you therefore do not get an access token. Without this access token, calls to /object/subscribe fail with a 401: Unauthorized error.

@gabidobo
Copy link
Member

gabidobo commented Jul 9, 2015

We have a demo Facebook app set up for the "http://localhost:3002/example/" URL, so the issue might be that your host or port is different.
The best solution would be to create your own FB test app, and then edit the appId in the FB.init function that you can see in index.html.

@Tails
Copy link
Contributor Author

Tails commented Jul 9, 2015

I am running the example using docker-compose with the following two files:

Dockerfile

FROM orchardup/nginx
ADD ./ /var/www
CMD 'nginx'

docker-compose.yml

telepatjs:
  build: .
  ports: 
    - "3002:80"

This will run the example on the right port on localhost. However, when I press the Facebook login button I get the following:

App niet ingesteld: This app is still in development mode, and you don't have access to it. Switch to a registered test user or ask an app admin for permissions.

@Tails
Copy link
Contributor Author

Tails commented Jul 9, 2015

But it works with my own Facebook app. Thanks.

@Tails Tails closed this as completed Jul 9, 2015
@Tails Tails reopened this Jul 9, 2015
@Tails
Copy link
Contributor Author

Tails commented Jul 9, 2015

I was mistaken. The logging in works but Telepat wants the user_about_me permission, which will take a week and some work to get granted. Without this permission the call to /user/login will fail with a 400.

@Tails
Copy link
Contributor Author

Tails commented Jul 10, 2015

This is also linked with telepat-io/telepat-api#1. In that issue it is said:

This is useful if you want to give some data access rights only to logged-in users, for example, but generally you can use Telepat without needing to log users in.

Suppose I would want to use Telepat without the need to log users into Facebook (my case here for example). The JS example (in combination with the example scheme?) only shows how to use the application in combination with the Facebook login option. What would I need to do so the object/subscribe calls will work without the working Facebook /login authorization? Since currently that will result in mentioned 401 Authorization error.

@Tails Tails changed the title Cannot get access token from Facebook when running example, subsequent Telepat calls fail Example in combination with example scheme does not show how to use API calls without need for Facebook login Jul 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants