SpringBoot+Vue implements third-party Gitee login (1)

1. Gitee login introduction (test website: address )

       Third-party websites mainly access the Gitee open platform by using "Gitee Login". "Gitee Login" is a service provided by the Gitee open platform to third-party websites. "Gitee Login" allows users to use Gitee accounts to log in on third-party websites and share content

Content and synchronous information, greatly reducing the threshold for user registration.

      At the same time, based on the binding information provided by users, the third-party website uses Gitee's huge user base to further spread the information of the website through friendship, increasing the number of visits and users of the website.

     OAuth : OAuth (Open Authorization) is an open standard that allows users to authorize third-party websites to access their information stored on another service provider, without the need to provide usernames and passwords to third-party websites or share all content of their data .

    Gitee login OAuth2.0 : For user-related OpenAPI (such as obtaining user information, etc.), in order to protect the security and privacy of user data, third-party websites need to explicitly ask for authorization from users before accessing user data.

2. Become a developer

     Developers can access the Gitee open platform through the following steps: Register a developer → create an application → obtain interface permissions.

2.1 Register Gitee account

  Register/login an account on the Gitee official website as required (official website address: login-Gitee.com ), and complete the login

3. Website application and mobile application access application

    Before the application is connected, an application must be made first to obtain the corresponding appid and appkey, so as to ensure that the website and users can be correctly authenticated and authorized in the subsequent process.

3.1 Create an application

1. After successful login, click the "Avatar" button and click the "Settings" button

2. Jump to the settings page, select the "Third-Party Application" button in "Data Management", click Create Application, mine has been approved and an application has been created.

3. Fill in the relevant application information and check the permissions required by the application. Among them: the callback address is the address where Code Cloud calls back to the application after the user authorizes, and returns the authorization code.

Note: The Gitee callback address does not require a domain name, just use your own computer ip address

Note: The Gitee callback address does not require a domain name, just use your own computer ip address

Note: The Gitee callback address does not require a domain name, just use your own computer ip address

 

4. Fill in the website information, click "Create Application", the website application is created, and the Client ID  and  Client Secret will be generated . They will be used in the basic flow of OAuth2 authentication above.

3.2 At this point, the preparatory work is over, and the website development process (introduced in the next part)

3.3 Everyone's project needs are different, and different problems may arise. This article is for reference only

3.4 SpringBoot+Vue implements third-party Gitee login (2)

3.5 Other third-party login methods: https://www.cnblogs.com/liyhbk/category/2089783.html

4. Source code purchase

4.1 Concise version ( Taobao source code )

Including login, third-party login, jump homepage, SpringBoot+SpringSecurity+Mysql+Redis+Vue+ElementUI, etc.

4.2 Multifunctional version ( Taobao source code )

Including login, registration, third-party login, complete system management module, system tool module, system monitoring module, personal center, etc., SpringBoot+SpringSecurity+Mysql+Redis+Vue+ElementUI, etc.

Guess you like

Origin blog.csdn.net/liyh722/article/details/130614678