Facebook API v3.2 connection issue with Rfacebook package in RStudio - r

I'm connecting to Facebook API v3.2 in order to get my friends information. I had the following error:
Invalid Scopes: user_relationships, publish_actions. This message is only shown
to developers. Users of your app will ignore these permissions if present. Please
read the documentation for valid permissions at:
https://developers.facebook.com/docs/facebook-login/permissions
How to fix this issue using API v3.2?
I have proceeded to the following steps:
I connect to the Facebook API via App: I have created a new Facebook APP (from https://developers.facebook.com) and set it up by default.
I connected to the Facebook API v3.2 via authentication token (from https://developers.facebook.com/tools/explorer) and I obtained access token of all necessary permissions.
I used this R code in RStudio to connect to my API:
install.packages("devtools")
library(devtools)
# I used install_github to get the updated version of Rfacebook package
install_github("pablobarbera/Rfacebook", subdir="Rfacebook")
require (Rfacebook)
I used this fb_oauth to connect my R session with the App I already created and authenticate it to my Facebook profile for Data Mining.
fb_oauth <- fbOAuth(app_id="My_APP_ID", app_secret="MY_APP_SECRET_KEY", extended_permissions = TRUE)
I expect that the token will give access to some of the authenticated user's private information (birthday, hometown, location, relationships) and that of his/her friends, and permissions to post status updates as well as to access check-ins, likes, and the user's newsfeed.
But I got the following error on RStudio command line.
Copy and paste into Site URL on Facebook App Settings: http://localhost:1410/
When done, press any key to continue...
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
Error in oauth2.0_access_token(endpoint, app, code = code, user_params = user_params, :
Bad Request (HTTP 400). Failed to get an access token.

Related

How to put google credentials into shiny web app without login

I have created my google authentification and got this:
googleAuthR.webapp.client_id
googleAuthR.webapp.client_secret
I want to put these credentials into my shiny web app,
with the goal that my shiny app can read and write from a (public) spreadsheet
without doing this before:
The googlesheets4 package is requesting access to your Google account
Select a pre-authorised account or enter '0' to obtain a new token
Press Esc/Ctrl + C to cancel
I want do deploy my shiny web app on the R server, but it failed because of missing credentials
Warnung: Error in : Can't get Google credentials. (from Log file)
How can I make it possible?
I found some solutions with login, but everyone should use these dashboard without logging in
I created OAuth 2.0 Client IDs
And tryed these code:
gs4_auth(
email = "my#gmail.com",
path = jsonsecret,
scopes = "https://www.googleapis.com/auth/spreadsheets",
cache = gargle::gargle_oauth_cache(),
use_oob = gargle::gargle_oob_default(),
token = ".secret"
)

Authenticate the user using customized external API

I have a customized third party server that handles all the rest apis. I am using Meteor as a middleware where the user logs in and accesses all the pages. All the information in those pages is basically generated using my actual web server (built in Symfony).
So using meteor HTTP.post I send user email and password as params, and my website API returns a json with a success or failure message. On successful login, it sends back a token.
What I am not being able to do is to, as according to this success message, "login" the user on my Meteor app without creating/checking Users collection from accounts.
The flow should be: successful login? authenticate the user, consider it as logged in user and store its token in session (without storing anything on this middleware). error? prevent the user from accessing private urls
I have found various packages, but they all target specific third party servers like:
Facebook with accounts-facebook
Google with accounts-google
GitHub with accounts-github
Twitter with accounts-twitter
Meetup with accounts-meetup
Meteor Developer Accounts with accounts-meteor-developer
Can this be done?

Account Locked in API Manager Store & Publisher 2.1.0

Is there a way to lock a user's account after a certain number of failed login attempts to the API Store and API Publisher? I already check at FAQ API Manager, but then the documentation redirect to Identity Server files.
Its there any method on how to solve this issues?
Thank You.
You can change the following properties in APIM_HOME/repository/conf/identity/identity-mgt.properties file.
Authentication.Policy.Account.Lock.On.Failure.Max.Attempts
Authentication.Policy.Password.Expire.Time=0
# If account verification is not enabled, following property will decide where user must be lock or not after user is created
Authentication.Policy.Account.Lock.On.Creation=false
Authentication.Policy.Account.Lock.Time=0
Authentication.Policy.Account.Lock.On.Failure=false
Authentication.Policy.Account.Lock.On.Failure.Max.Attempts=0
You should first install following Identity Feature in WSO2 API Manager.
Account Recovery and Credential Management
version : 5.7.5
Then you will get the identity-mgt.properties file in your /repository/conf/identity directory.
By changing the following property value to the preferred number you can achive the account locking after several attempts.
Authentication.Policy.Account.Lock.On.Failure.Max.Attempts=0
Note :
To install the above feature,
Login to Management Console of API Manager 2.1.0 (httpso://localhost:9443/carbon)
Go to Configure > Features > Repository Management and add the following repository.
http://product-dist.wso2.com/p2/carbon/releases/wilkes/
Then search for "Account Recovery and Credential Management Feature".
Select and install the version 5.7.5 as below.
Restart the Server.

RGA Invalid Credentials

I try to use the RGA Package (https://github.com/artemklevtsov/RGA) to get Data from Google Analytics core API.
authorize(
client.id=options()$apiSecrets$id,
client.secret=options()$apiSecrets$clientSecret,
cache=paste(getwd(),"daToken",sep="/")
)
So the cache is set to something like /User/foo/bar/daToken. I can see the file and everything works just right, I can access the data for now. After 30-60 minutes however the token expires it seems. Now on a new attempt there will be the error message Error : client error: (401) Unauthorized Auth error: Invalid Credentials
Why is the token not working any more? How to setup a longer live time? Plus: why is there an error and why does RGA don't try to get a new token?
Please read Google Oauth 2.0 documentation properly.
Access Token has lifetime of only 3600 seconds. After that you have to use Refresh Token to get new Access Token.
I have not used RGA package but I am sure there must be some mechanism to validate and refresh the Access Token.

User not found, or token is not authorized in R

Getting likes from facebook using following command
x <- getLikes(XXX, token=token)
XXX is the user ID of facebook account of person and token is created by Graph API Explorer.
Using this command, I find like activity of user and user's friend account. Out of 10 friends, I got the following Error for some users
likes <- getLikes(XXX, token=token)
Error in getLikes(XXX, token = token) :
User not found, or token is not authorized.
I create new token also but still I get same Error.
Please tell me what should I do to resolve this.
While authorizing a user are you enabling extended permissions as true?
If not, then you have to enable extended permissions as follows
fbOAuth(app_id="Your_app_id",app_secret="your_app_secret",extended_permissions=TRUE)
Once you do this the getLikes function should work properly for all users
It isn't working for you because facebook has stopped the service. Unless the user that you are requesting details from authorizes your application, you wont be getting the data

Resources