Configure Google Login
zhanghan
2024-06-23 18:12
· edited
Google provides the OAuth login method, allowing users to log in to applications that have integrated Google OAuth using their Google accounts. For users, this means they no longer need to remember different accounts and passwords, and for applications, there is no need to develop their own login and registration system. So it's a good thing for both users and application developers.
Blocklet Server supports configuring and enabling Google login for a Blocklet. Below is how to configure Google login in a Blocklet and use Google accounts to log in.
- Register your Google Account.
- Create project
- Open the website: https://console.cloud.google.com/cloud-resource-manager
- Click
CREATE PROJECT
- "Fill in the project name"
- Go to https://console.cloud.google.com/apis/dashboard
- Make sure that the top left corner of the screen displays the project you just created.
- Configure OAuth
- Click
OAuth consent screen
, selectExternal
, clickCREATE
- Fill in the necessary information according to the instructions on the page
- Click
- Create credentials
- Click
Credentials
, clickCREATE CREDENTIALS
, selectOAuth client ID
- Select
Web application
, fill inName
, configure the domain name of the Blocklet that needs Google login according to your needs, and replacedemo.blocklet.dev
with the corresponding fields as shown in the figure. - After clicking on
CREATE
, the page will display a success message. - Save
Client ID
andClient secret
- Click
- Configure Blocklet
- Arrive at the control panel of Blocklet, click "Dashboard", "Configuration", "Login", "Third Party Login" in order
- Fill in the just saved
Client ID
,Client Secret
, save
- At this time on the Blocklet login page, you can see that you can log in via Google.
- Click
Google
to log in.
- Click
Sticker