Google Sign-in with Angular Front End
Last updated
Was this helpful?
Last updated
Was this helpful?
Here is Google sign-in official website:
However, I found Angular Social Login library will be easier to use:
Go to this url and login with your google account.
Create a new project if you don't have one.
You need to register OAuth consent form screen
Under App information section, put your apps basic info.
Under App domain section, put as your application home domain.
Under Authorized domains, leave it as blank
On Scopes tab, choose the information you request users to authorize for your app.
On Test users tab, you can only test with test user for 100 times if you have , and put your testing google account here.
On summary tab, you can review the information.
Once you have the OAuth consent form, you can create Credentials now
Select OAuth clientID
Select Web application as Application type
Under Authorized JavaScript origins, put
Under Authorized redirect URIs, put
Once completed, it will pop up Your Client ID and Your Client Secret which will be used in your angular app.
It's simple to follow the steps on the official web site.
Settings in app.module.ts file
Add SocialLoginModule
Add your app client ID in the providers
Add a login button at your html
At your type script file, call google api with angularx-social-login
Check your browser console to see if you get the response from Google.