Nebular googleauth getting user info - google-authentication

I'm using NbOAuth2AuthStrategy.
No problem with login or retreiving access token, but when i'm trying get info about user by token using this
There is a troubles:
i tried use localhost and https://ngrok for ssl but it stil doesnt work, what is problem?

Try changing the url to:
https://www.googleapis.com/oauth2/v3/userinfo?access_token=<your_access_token>
and you should retrieve a JSON with these properties:
sub
name
given_name
family_name
picture
locale

Related

Can we get FacebookAccessToken from FirebaseAuth?

With Flutter, I am able to login with Facebook, and later I want to get the FacebookAccessToken because it is needed to correctly get the user photoURL.
Is there a way to get the token from FirebaseAuth? Or I must store this value in my code?
Login part, we have the access token:
FacebookLoginResult result = await new FacebookLogin().logIn(['email', 'public_profile']);
...
FacebookAccessToken accessToken = result.accessToken;
Now, let's say in another Widget, we want to get the user photoURL
final auth = FirebaseAuth.instance;
String url = auth.currentUser.photoURL;
This url must be appended with ?accessToken=<access_token> retrieved during the first step. There is a bug created. But for now, can we directly get it from FirebaseAuth?
The Facebook access token is available from the auth result immediately after the user signs in from the FacebookAuthCredential object as result.credential.accessToken. It is not available from the current user, so if you don't capture immediately after sign-in there's no way to find it later without going back to the Facebook SDK.
Also see:
Can I get a facebook access token from firebase.auth().currentUser?
How to get provider access token in Firebase functions?
Get Facebook/Google access token on Firebase Auth#onAuthStateChanged?

(#100) Unknown fields: username facebook

We had built widgets for Facebook in Salesforce (Force.Com) Enterprise Version Environment using their API which has stopped working from some time.
We are getting error of "Unknown field:Username" when we are using username in the endpoint url on the profile search. Although, we know that username is no longer available in the endpoint URL from V2.0. So , anyone kindly suggest any other way to make profile search possible(on username) without using username in the endpoint URL.
Error : (#100) Unknown fields: username
Simply put:
To search for a username is no longer possible. You can try
/search?q=mark%20zuckerberg&type=user
to search for a user by his real name.

How to get user access token in Meteor.JS after logging in by facebook

After I'm logged in using facebook account I have access to Meteor.userId()
So I tried to publish user data this way from the server:
Meteor.publish('getUserAccessToken', function(userId) {
return Meteor.users.find(userId).fetch();
});
And receive it on client:
Meteor.subscribe("getUserAccessToken",Meteor.userId());
then I would like to dig through returned user object to it's accessToken
console.log([Object].services.facebook.accessToken);
but since I remove autopublish services.facebook disappear for client.
Thanks in advance for any help.

creating album and posting a photo in facebook page

I'm trying to create an album and post photo to it , these operations have to be done on a "facebook page". Before writing any code i tested it on graph api explorer :
i tries following to create an album
/page_id/albums method:post
fields :
name : "test"
access_token : "valid access_token"
i got the above mentioned access token after granting permissions like :manage_pages , photo_upload . Any ideas where i might be going wrong.
I have gone through the documents and stackoverflow questions but can't seem to figure out the problem.
i resolved the error , we have to set the access token to access token of the page . the access token can be obtained by issuing :
/me/accounts using get method.
also important thing is this will only show the list of pages to which the current user is admin to.
the access token received from the graph explorer is valid for only 1 hour, but if you receive the access token by issuing $facebook->api('/me/accounts') in php then that access token never expires.
to check if the access token is valid and related info the following link can be used to check:

Customizing plays fbconnect module

When i'm trying to log in to facebook with button from fbconnect module, I am getting nullpointer at this line:
String email = data.get("email").getAsString();
where data is JsonObject. So I checked this json response from facebook, and found that has many data, but email isn't included.
I suppose i have to change something in fbconnect module, like change request, to get more data from facebook, can somebody tell me where and how ?
Im talking about play framework ofc.
You need the email extended permission to access the email field for a user - ensure you have this by calling /me/permissions with your access token - it'll show you the permissions your access token has
Add the email scope tag to your fbconnect button:
#{fbconnect.button label:'Login using your facebook account.', scope:'email'/}