Am trying to get the admin user of a chat using the following.
client.iter_participants(channel, filter=ChannelParticipantsAdmins)
But using this I can only get the admin user of the channel, but not the admin user of the chat.
Related
I want to show different UI according to the user sign-in. if the user signs in with the user email app will navigate to the user page. and if the admin signs in with the admin email app will navigate to the admin page. How can I achieve this in Firebase
I don't want to validate in the frontend
First check if the user is loggedIn or not
-> If logged in :
-> Fetch User data from Firestore then
Scaffold(body:(user.role == 'Admin')? AdminView(): UserView())
I am in the middle of creating a Flutter application and am stuck on how to implement authentication using email/password and social providers like Google and Facebook. Everything works except my approach on how to get user details to store in Firebase like address, phone number, username, etc. Implementing this when working with email/password registration has been simple because I created a multi screen form and then finally registered the user which would log them in. The problem with getting additional details when working with social providers is that I would need to authenticate the user first before ever getting the chance to get additional details. How can I go about getting user details for users that choose to use Google and Facebook to authenticate?
One way is to prompt the user to enter the required additional details when the user logs in.
You should first check if the user logged in through a Social Media provider :
List<String> providerList = await FirebaseAuth.instance.fetchSignInMethodsForEmail(_email);
fetchSignInMethodsForEmail will return a list of sign providers the user used to login to your app (if you haven't enabled account linking, this would probably be just one provider)
Here's a list of social media provider ID's :
GoogleAuthProviderID: google.com
FacebookAuthProviderID: facebook.com
TwitterAuthProviderID: twitter.com
GitHubAuthProviderID: github.com
AppleAuthProviderID: apple.com
YahooAuthProviderID: yahoo.com
MicrosoftAuthProviderID: hotmail.com
For example, if you have enabled Facebook login, you can check if the 'facebook.com' is available in the providerList, if so prompt a screen to collect your additional data and update your user record on Firestore for this user.
Admin can able to create users. After creating, the user will get system generated password and they can login with that password and can do some task. After login, I want to create some more users and they can also will have access to modules.
How can I do it in SugarCRM?
I am creating an app in which you can login via Facebook, Twitter, or our own internal mechanism. The issue is the following scenario:
I open the app and login using Facebook
I logout
I open the app and login using Twitter
The above scenario will result in me as a user having two accounts in the system. How do I prevent this from happening so that I have one account and it doesn't matter whether I login using Facebook/Twitter?
Every time a user login using Facebook I am as well creating an internal account, with the Facebook username and Facebook id as password. The same thing when I login using Twitter I am creating an internal account with the Twitter user name and id as password.
An idea came in my mind to solve this:
When a user logs in using Twitter check the name and email if a user with that information already exists in the database. However, the name and email they use in both Facebook and Twitter might not be the same, so this might not work all the time.
You can't make this work with your current flow (when the user logs in then logs out again). Instead you should allow a user to login with either their Facebook or Twitter credentials and then, whilst they're still logged in, get them to associate their account with their other service with that user.
So, the flow would be something like:
New user arrives at site User logs in with Facebooks oauth2
mechanism
Your server receives their FB ID and generates a new user
in your systems. Stores their FB ID against that user.
You prompt
the user to add their twitter auth credentials. User logs in with
Twitter oauth2 mechanism
Your server receives their twitter ID,
checks to see if a user is currently logged in with your
application. Because there is, you save the twitter ID agains the
current user.
Later, the user can log out and then log in with either service.
How do they manage to get user to login to Twitter / Facebook through Javascript so smoothly?
I am trying to replicate it for the web app. Basically, the user only needs to add a javascript snippet to their site to kickstart but I am clueless as to how to integrate facebook and twitter connect seamlessly.
Do they store access tokens after successfully authenticating a user?
Short answer is yes, they store access tokens after successfully authenticating a user.
After you try facebook and twitter apis, you'll see that, they both returns ids for every user who succesfully logged-in through your application. You can then simply add those ids pairing with the platform they logged in to your database. You can then use that data to track users easily.
You need to
Create applications on both platforms
Have pages for each provider to check if user performed a succesful login
Check if user is a newcomer and add that user to your database if so.
Set a session or cookie variable of user's local id in your own application or do whatever you are normally doing to track if a user logged-in as that user is your local user.