how to integrate google 2 factor / 2 step authentication in react app - reactjs

I want to add google 2fa authentication for my react app. How can I
generate QR code for my app?
Will this be a static or a dynamic code?
Where do I need to send the secret (6 digit / 8 digit) code for
authentication once the user copies it from the google-authenticator
mobile app.
what google-api need to be enabled for this app in the
console.google.developer.com, like we enable G+ api for google sign-in?
need help!

Related

Reactjs firebase google authentication showing project id instead of Public-facing name

In my reactjs project, I use firebase 9.6.11 for email, google and facebook authentication.
When I call the signInWithPopup() and google sign in form, Sign in
to continue to show projectid.firebaseapp.com. I have already update Public-facing name at firebase's project setting.
Even though I have add custom domain, google sign in for redirect link also using projectid.firebaseapp.com url.
My project is hosting on firebase hosing and link with web app.
If anyone facing this issue, please follow the step in here Step to change custom domain
For me, I forgot to enter OAuth 2.0 Client IDs's redirect url

Google Authenticaon in Django and React

Using django-allauth I've enabled google authentication on backend. I can sign in to my Django project and everything.
Now, I want to connect that authentication with my React frontend, so I can login/register using google on http://127.0.0.1:3000.
What do I need to do?
You can use Google libraries for javascript or some npm library that does that for you.
After logging in through Google account and getting associated authentication keys / data on front-end side, you send them to Django and django-allauth should handle that data for you - you have to have specific view for that linked in urls.py.
After such request either new social account will be created or already existing logged in.
It might be required to adapt some of original social account management views to handle data that you send from React.
Keep in mind that at the moment Google is switching to Google Identity Services, which works a little bit differently than old method implemented in django-allauth - there is already an issue raised in the repository.
https://github.com/pennersr/django-allauth/issues/3074
To use Google Identity you can try to use:
https://www.npmjs.com/package/#react-oauth/google
or any other library that supports this
After that if you want to do this yourself new way on Django side, you can send JWT token that comes from Google to Django, validate it based on Google documentation and then create social account / sign in. That currently requires overriding some of original django-allauth views / forms for social accounts.
https://developers.google.com/identity

Integrate g-suite (google) for signup and get user roles in desktop application

I am developing a desktop application using react electron boilerplate.
I need to integrate google signup, but it will not work since google providing the token in a redirect url.
Since it is a desktop application, I cannot fetch values from a url.
https://github.com/chentsulin/electron-react-boilerplate
How can I use google authentication and g-suite APIs in my app.
Help would be very much appreciated.

Facebook Login for an Ionic app powered by Yii2 and Drupal

May be I am overcomplicating things and overthinking of a solution but this is what I am trying to accomplish:
I have an app that uses Ionic Angular JS as the frontend with multiple restful services from the backend. I am using a combination of Drupal and Yii2. Both of the apps can support Facbook login / sign up as web apps as the modules are available. Ionic app by itself can use FBLogin by using NGCordova. However, I need to do the following:
Login to Ionic app using Facebook Login.
Using this login create an account in both my Yii2 and Drupal 7 apps. (I can sacrifice one or the other if I really need to. I have two backends because I need one to store the custom logic an another for the content management.).
User should be able to create new nodes in both of the apps. (Yii2 will have a higher priority).
Any guidance will be great. Eventually I may expand FB login capability to Google ID as well.

GoogleApp Engine authentication using Google ID from Blackberry

I am developing an app to be hosted on Google App Engine. Users will be able to use their Google IDs to login to the app. The app also has a client counterpart in the form of a Blackberry Application.
My question is - is there a suggested way for my app to collect the user's Google credentials so that I can authenticate it against Google using OpenID semantics? In Android, for example, I can use the Accounts API so that I don't need to explicitly ask the user to enter credentials. What's the way to do this in Blackberry?
I see 2 ways, neither of which is ideal:
Write my own form in my native Blackberry app where the user enters Google ID and password, which I then use to obtain the authenticator token and perform the rest of the authentication behind the scenes. But the point is - it is inappropriate to ask a user to trust my app with their Google credentials.
Use standard Google Open ID Authentication mechanism - which opens up the web browser and displays Google's Open ID login page. Although this is a one-time thing (after which I can save the authentication token so that future requests to GAE do not require any prompting for credentials), the user experience is still disruptive since it involves opening the browser in addition to my native BB app.
So, what's the suggested way forward?
Using the browser to authenticate is pretty much the only standard way to do this. A number of Android apps do this for OAuth or OpenID endpoints too. Depending on how the Blackberry's protocol handlers work, you should be able to set a continue URL that results in your app being called back by the browser when authentication completes.

Resources