I have my front-end rails app that uses AngularJs too and I also have an api backend also written in Rails (used rails-api
gem). I have implemented login system for this system. Now I want to implement login with facebook/google
. I have searched through internet and so far I found this blog. From this blog, I got the idea of implementing google OAuth 2
in Android with Rails as backend. But In my case I want to implement google OAuth 2
in my front-end app (Rails + Angular) with Rails as backend.
For implementation of google OAuth 2
, Front-end app need to request the token
to google oauth2 authorization server
and I have no idea on how to do it.
Also, Is it good to use rails for requesting the token or I can use Angular for that part. What would be the best practice for this purpose?
hello.js
in your front-end then validate the token in your backend. – Hanes