Third-party login authorization can be annoying for many developers, with each platform having to obtain its own permissions, which can be very cumbersome in practice. The open source project recommended by Gitee today is developed for this pain point. It integrates more than ten common third-party platforms at home and abroad at a time. It only needs to call a simple API to get it done.

Project name: JustAuth

Project author: Yadong. Zhang

Open Source License: MIT

The address of the project: https://gitee.com/yadong.zhang/JustAuth

Project introduction

JustAuth, as you can see, is just a third party authorized login tool class library. It takes us away from the tedious third party login SDK and makes login So easy!

Currently, it supports Github, Gitee, Weibo, Dingding, Baidu, Coding, Tencent Cloud Developer Platform, OSChina, Alipay, QQ, wechat, Taobao, Google, Facebook, Tiktok, linkedin, Xiaomi, Microsoft, Toutiao, Teambition, StackOverflo Authorized login of w, Pinterest, Renren, Huawei, enterprise wechat, Kukule, Gitlab, Meituan, Ele. me, Twitter and other third-party platforms.

Project characteristics

Full: has integrated more than ten third-party platforms (domestic and foreign common basic have been included), is still continuing to expand!

Jane: APIS are designed to be as simple as possible, so that you can use them without any obstacles!

Quick start

  • Introduction of depend on
<dependency>
    <groupId>me.zhyd.oauth</groupId>
    <artifactId>JustAuth</artifactId>
    <version>1.15.5</version>
</dependency>Copy the code
  • Call API
// Create authorization Request
AuthRequest authRequest = new AuthGiteeRequest(AuthConfig.builder()
        .clientId("clientId")
        .clientSecret("clientSecret")
        .redirectUri("redirectUri")
        .build());
// Generate the authorization page
authRequest.authorize("state");
// Auth_code (alipay only) and state will be returned after authorized login. After version 1.8.0, you can use the AuthCallback class as a callback interface parameter
// Note: JustAuth saves state for 3 minutes by default. If it is not used within 3 minutes, the expired state will be cleared automatically
authRequest.login(callback);Copy the code

Either of the following HTTP tool dependencies exists in the project, ignore them

  • hutool-http
<dependency> <groupId>cn. Hutool </groupId> <artifactId>hutool-http</artifactId> <version>5.2.5</version> </dependency>Copy the code
  • httpclient
< the dependency > < groupId > org, apache httpcomponents < / groupId > < artifactId > httpclient < / artifactId > < version > 4.5.12 < / version > </dependency>Copy the code
  • okhttp
< the dependency > < groupId > com. Squareup. Okhttp3 < / groupId > < artifactId > okhttp < / artifactId > < version > 4.4.1 < / version > </dependency>Copy the code

If you do not have the third party login you would like, you are welcome to participate in the project. Now click the link to go to the project home page and talk to the author: gitee.com/yadong.zhan…