How to retrieve username of Facebook user in Dialogflow? - dialogflow-es

What is the procedure to retrieve the user name of Facebook user when try to login our bot from Facebook channel?
Let share us any document or procedure to get the user name of Facebook login user to our bot.

Related

Username in azure b2c user flow

I want to capture the username of the user during registration using user flow. I couldn't find that in attributes and even didn't find the azure user profile list. I am getting username attribute in login id token but that is coming as empty. I want to understand how azure b2c captures username of user and is there any capability to take unique username during registration using user flow
https://learn.microsoft.com/en-us/azure/active-directory-b2c/user-profile-attributes#azure-ad-user-resource-type
I tried to create custom attribute for username but sadly we can add validation using user flow, want to understand how to use build in username
If you want to use custom policies, have a look at the samples e.g. this one for username.
You can set up the local account identity provider as User ID signup in the SignUp/SignIn user flow by navigating to Identity providers which will allow to SignUp during registration with the username and password.
In the users, you can see account has been created with username with signIn type userName.
This userName can be used to Signin to your application.
Reference: https://learn.microsoft.com/en-us/azure/active-directory-b2c/identity-provider-local?pivots=b2c-user-flow

Google oauth, Facebook

When A person has a Gmail /Facebook account sign with EXAMPLE#GMAIL.COM. Then user data is stored in MongoDB. But how can we show the user who is logged in to my application/ website?
in my case, I am able to get the user who logged in and storing the data in mongodb. But I'm not able to show the user who is logged in.
How can I show the login user in the place of the login?

facebook graph api : subscribe someone else's page to my app

I am creating a Facebook bot using which user can chat with the Facebook page.
Following is the scenario:
Allow user to login with his Facebook account along with required
permissions
Show user list of his pages
When user select on of the page; subscribe MY FACEBOOK APP to
that page
Setup webhook for app
Send-Receive message to/from user's Facebook page
I am having trouble with 3rd point. I tried to subscribe app using following code as mentioned in facebook docs
FB.api(
'ACCESS_TOKEN',
'/<PAGE_ID>/subscribed_apps',
'POST',
{"subscribed_fields":"[\n \"feed\"\n]"},
function(response) {
// Insert your code here
}
);
and it returns following response:
{
"success": true
}
The problem is- I don't know which app is subscribed for this page; I can have 100 apps. Graph api don't have provision to provide app id which need to subscribe against user page.
This is facebook doc for subscription
In order to get page access token for app, you need to use same app to login user and to subscriber to user's page.
This makes total sense as user is granting our app to their pages and provide us access token with the reference of our app.
Solution :
Allow user to login with his Facebook account along with required
permissions and your Facebook app
Show user list of his pages
When user select on of the page; subscribe YOUR FACEBOOK APP to that
page using page access token obtained in step 2
Setup webhook for app
Send-Receive message to/from user's Facebook page

To get user id from username in instagram api

Any ways to get user id from username in instagram api?
Other than user/search endpoint and instagram front code cracking (https://instagram.com/{username}/?a__=1)
You can get user id from username using instagram api.
Register your app here:https://www.instagram.com/developer and submit review for public_content permission.
Using their https://www.instagram.com/developer/endpoints/users/#get_users_search
api you can get information about user.
To get working above api make sure you have public_content permission approved for your app.

Libstpotify API - How can I use a single sign in process to connect to both Spotify and Facebook?

In my libspotify-based app, can I prompt the user for a single sign-in with his (Facebook) credentials to connect both to Spotify and Facebook ?
Scenario #1 could be :
My libspotify-based app is also a registered Facebook app.
User authorizes and connects to my app using his Facebook credentials.
Thanks to that user session I would like to connect to his Spotify account
Is that possible ?
Or Scenario #2... which goes against oauth security :
User connects to my libspotify-based app with his facebook credentials (it works)
the app somehow - how ? - gets Facebook session tokens
the app uses those tokens to access authorized facebook info such as what the user's friend listen to and so on.
the app uses those tokens to require more permissions ?
Or is there a better scenario so I can achieve this single sing-in process ?
Thanks for your help.
This login flow isn't possible with libSpotify — the user has to log in with a username or password, whether it's a Spotify or Facebook account and you can't extract a Facebook auth token from libSpotify once it's logged in.

Resources