Xamarin.Forms + FB Login with MySQL - mysql

I'm looking at using FB login to my MySQL DB via PHP API using Xamarin.Forms rather than setting up login/registration myself in MySQL.
I can do the FB login part, check for success and get the FB_ID. Once that done, I can check the FB_ID if exists in my DB and populate DB etc.
I don't understand the process how to securely check for FB login pass/fail and use that flag to access MySQL. The process checking the FB login pass/fail is within the app itself (IF FB_login_ok then fetch the data from MYSQL based on FB_ID), so one can easily edit the app.
I'm passing all the data to PHP API using JWT/HTTPS and I'm planning to use JWE if xamarin.forms has support for it.
Can someone please direct/explain to me how to achieve using the FB login to authorize MySQL DB login?

Related

React Native Local Database Sync with Mysql

Is possible to Offline sqlLite saved data send or sync with live MySQL database in server side ?
I found my own solution to this scenario.
I try to build up React Native mobile app working with Laravel backend(PHP) and my app working online and offline both. So my mobile app using Realm (of MongoDB) to app db and MySQL in severe side (Laravel). I create the flag field in both dbs to know that row is sync or not and i develop the function to check that flag field and sync to both db and update flag field as my wish. You can try this with SQLite or any other mobile db.
Realm:https://docs.mongodb.com/realm/
The most easy way to do so is to use WatermelonDB.
See: https://github.com/Nozbe/WatermelonDB
It provides a syncing option from which you can automatically sync your database with the backend. It uses SQlite on it back. For synchronisation see:
https://nozbe.github.io/WatermelonDB/Advanced/Sync.html

how to get windows login using node js

We have been developing a web application using HTML, CSS, Node JS and MongoDB. our requirement is to authenticate user while launching the application. We want to authenticate user with windows login credential.(SSO login)
How we can get it and validate it against the user collection in mongodb using NodeJS/HTML?
Please guide.
You can use the node-expose-sspi. It will give you SSO with Windows user account on NodeJS.
https://github.com/jlguenego/node-expose-sspi
Note: I am the author of this module.

migration from normal chat to ejabberd chat

I have been using the normal javascript ajax chat i created manually. I also used this same format to create phone android messenger app. But it was using normal sockets.
so i have migrated to using ejabberd IM server and have developed the xmpp client messenger and it is working well with mysql module configurations.
But now i have history chats for messages by users and want to maintain the message. So i want to transfer these messages to the new database table called archive under ejabberd.
I have failed import the messages as they are very many in thousands.
so if some one know a script i can use to do the migration of data to the new database that will be good.
To my knowledge, there is not template migration script you can adapt already, but that would make a good contribution for ejabberd.

How to authenticate the user in offline mode in Azure Active Directory?

Am developing a Windows Store 8.1 app using C# and xaml.
In the app, Initially user will log in into the app using Azure Active directory single sign on log in(With Internet connection)
But how to authenticate the user in Azure Active Directory when the user is not connected to the internet?
I want my app to work in offline mode too..
How can i achieve this?
When you 'log in', there should be an artifact produced. In the case of OpenIdConnect there is an id_token, OAuth produces an AccessToken. If those are captured and stored securely, then there will be evidence that the user did authenticate to AAD at one time. The artifacts of that 'log in' have expiration times.
Backing up, when a user logs in, how is that identity used? Do you managed protected resources yourself OR do you reach out for them?
you can use SQL lite and save the user's details in it by encrypting it..
The next time when he logs into the app you can simple validate his credentials against his details from the DB like you would do in any website/webapp.
Side note : We have a service which runs in the background every 4 hours to check if the user's credentials have changed, if its changed fetches the new credentials and updates it in the local sql lite db

How to access server MySQL database from iOS app

I'm trying to write an iOS app using Xcode.
A simple login prompting username and password.
I have no idea how to open a database connection to validate the username and password.
The database I use is mysql.
I tried using this link http://macbug.org/macosxsample/mysql#.Ur8AYBbtGPF
but I get an error when I tried to add libmysqlclient.a to the frameworks and library.
If your database is on a server somewhere, then you would generally not have your iOS app interact directly with the database server, but rather you would write a web service that the app would interact with (via NSURLConnection, NSURLSession or something like AFNetworking), and the web service would interact with the MySQL database.
In terms of how to write a web service, often, when people are writing their first web service, they'll use some simple technology like PHP. Do you know what options you have on your server? If PHP is an option, then you can check out Ray Wenderlich's How to Write a Simple PHP/MySQL Web Service. Then check out How to Write an iOS App that Uses a Web Service.
You should use SQLite instead of MySQL for iOS application. You are referring MacOSX application tutorial. try this http://www.raywenderlich.com/913/sqlite-tutorial-for-ios-making-our-app