Configure GitHub login
zhanghan
2024-11-05 14:10
· edited
Github provides OAuth login method, users can log in to GitHub OAuth-enabled applications through their GitHub accounts. For users, they no longer need to remember different accounts and passwords; for applications, there is no need to develop their own login and registration system. So, it is a good thing for both users and application developers.
The Blocklet Server supports configuring and enabling GitHub login for a Blocklet. Below is how to configure GitHub login in a Blocklet and use a GitHub account to complete the login.
- Sign up for a GitHub account
- Create GitHub OAuth project
- Open https://github.com/settings/developers
- Click
New OAuth App
, fill in the corresponding information as prompted on the page. Replacedemo.blocklet.dev
with the domain of the Blocklet for GitHub login configuration as shown in the figure below. - Application name: Fill in the application name, support customization.
- Homepage URL: Fill in the address of the application homepage, such as:
https://demo.blocklet.dev
, remember to replace demo.blocklet.dev with the domain of your application. - Authorization callback URL: Fill in the callback address of the application, such as:
https://demo.blocklet.dev/.well-known/service/oauth/callback/github
, remember to replace demo.blocklet.dev with the domain of your application.
- Click on
Register application
, and you will be taken to the details page of this OAuth project. - Click
Generate a new client secret
- Save
Client ID
andClient secrets
- Configure Blocklet
- Arrive at the control panel of Blocklet, click "Dashboard", "Configuration", "Login", "Third Party Login" in sequence.
- fill in the
Client ID
that was just saved,Client Secret
, save
- At this time on the login page of Blocklet, you can now see the option to log in with GitHub.
- Click on
GitHub
to log in.
- Click on
Sticker