README.md 6.7 KB
Newer Older
智布道's avatar
智布道 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<p align="center">
	<a href="https://www.justauth.cn/"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/logo.png" width="400"></a>
</p>
<p align="center">
	<strong>Login, so easy.</strong>
</p>
<p align="center">
	<a target="_blank" href="https://search.maven.org/search?q=g:%22me.zhyd%22%20AND%20a:%22JustAuth%22">
		<img src="https://img.shields.io/badge/Maven Central-1.0.0-blue.svg" ></img>
	</a>
	<a target="_blank" href="https://gitee.com/yadong.zhang/JustAuth/blob/master/LICENSE">
		<img src="https://img.shields.io/badge/License-GPL%20v3-yellow.svg" ></img>
	</a>
	<a target="_blank" href="https://www.oracle.com/technetwork/java/javase/downloads/index.html">
		<img src="https://img.shields.io/badge/JDK-1.8+-green.svg" ></img>
	</a>
</p>

智布道's avatar
智布道 已提交
19 20 21 22
<center>
    <table>
        <thead>
            <tr>
智布道's avatar
智布道 已提交
23 24 25 26
                <td align="center" width="200"><a href="https://gitee.com/"><img src="https://gitee.com/logo_icon.png" width="30"></a></td>
                <td align="center" width="200"><a href="https://github.com"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/github.png" width="30"></a></td>
                <td align="center" width="200"><a href="https://weibo.com"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/weibo.png" width="30"></a></td>
                <td align="center" width="200"><a href="https://www.dingtalk.com"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/dingding.png" width="30"></a></td>
27 28
                <td align="center" width="200"><a href="https://www.dingtalk.com"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/baidu.png" width="30"></a></td>
                <td align="center" width="200"><a href="https://www.csdn.net/"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/csdn.png" width="30"></a></td>
智布道's avatar
智布道 已提交
29 30
                <td align="center" width="200"><a href="https://connect.qq.com/devuser.html#/"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/qq.png" width="30"></a></td>
                <td align="center" width="200"><a href="https://mp.weixin.qq.com/cgi-bin/loginpage?t=wxm2-login&lang=zh_CN"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/wechats.png" width="30"></a></td>
智布道's avatar
智布道 已提交
31 32 33 34
            </tr>
        </thead>
        <tbody>
            <tr>
智布道's avatar
智布道 已提交
35 36 37 38 39 40 41 42
                <td align="center" width="200"><a href="#授权Gitee">Gitee</a></td>
                <td align="center" width="200"><a href="#授权Github">Github</a></td>
                <td align="center" width="200"><a href="#授权Weibo">Weibo</a></td>
                <td align="center" width="200"><a href="#授权钉钉">钉钉</a></td>
                <td align="center" width="200"><a href="#授权百度">百度</a></td>
                <td align="center" width="200"><a href="#授权CSDN">CSDN</a></td>
                <td align="center" width="200"><a href="#授权QQ">QQ</a></td>
                <td align="center" width="200"><a href="#授权微信">微信</a></td>
智布道's avatar
智布道 已提交
43 44 45 46
            </tr>
        </tbody>
    </table>
</center>
智布道's avatar
智布道 已提交
47

智布道's avatar
智布道 已提交
48 49 50
-------------------------------------------------------------------------------


智布道's avatar
智布道 已提交
51

智布道's avatar
智布道 已提交
52
JustAuth,如你所见,它仅仅是一个**第三方授权登录****工具类库**,它可以让我们脱离繁琐的第三方登录SDK,让登录变得**So easy!**
智布道's avatar
智布道 已提交
53

智布道's avatar
智布道 已提交
54
## 快速开始
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
- 引入依赖
```xml
<dependency>
    <groupId>me.zhyd.oauth</groupId>
    <artifactId>JustAuth</artifactId>
    <version>1.0.0</version>
</dependency>
```
- 调用api
```java
AuthRequest authRequest = new AuthGiteeRequest(AuthConfig.builder()
        .clientId("clientId")
        .clientSecret("clientSecret")
        .redirectUri("redirectUri")
        .build());
// 自动跳转到授权页面
authRequest.authorize(response);
智布道's avatar
智布道 已提交
72
// 返回授权页面,可自行跳转
73
authRequest.authorize();
智布道's avatar
智布道 已提交
74
// 授权登录后会返回一个code,用这个code进行登录
智布道's avatar
智布道 已提交
75
authRequest.login("code");
76 77 78
```

#### API列表
智布道's avatar
智布道 已提交
79
|  :computer: 平台  |  :coffee: API类  |  :page_facing_up: SDK  |
80
|:------:|:-------:|:-------:|
智布道's avatar
智布道 已提交
81 82 83 84 85
|  <img src="https://gitee.com/logo_icon.png" width="20">  |  [AuthGiteeRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthGiteeRequest.java)  | <a href="https://github.com/settings/developers" target="_blank">参考文档</a> |
|  <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/github.png" width="20">  |  [AuthGithubRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthGiteeRequest.java)  | <a href="https://gitee.com/api/v5/oauth_doc#list_1" target="_blank">参考文档</a>  |
|  <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/weibo.png" width="20">  |  [AuthWeiboRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthGiteeRequest.java)  |  <a href="https://open.weibo.com/apps?_blank" target="_blank">参考文档</a>  |
|  <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/dingding.png" width="20">  |  [AuthDingTalkRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthDingTalkRequest.java)  |  <a href="https://open-doc.dingtalk.com/microapp/serverapi2/kymkv6" target="_blank">参考文档</a>  |
|  <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/baidu.png" width="20">  |  [AuthBaiduRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthBaiduRequest.java)  |  <a href="https://developer.baidu.com/" target="_blank">参考文档</a>  |
智布道's avatar
智布道 已提交
86
|  <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/csdn.png" width="20">  |  AuthCsdnRequest  |  待续 |
智布道's avatar
智布道 已提交
87
|  <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/qq.png" width="20">  |  AuthQqRequest  |  <a href="https://connect.qq.com/" target="_blank">参考文档</a>  |
88
|  <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/wechats.png" width="20">  |  AuthWechatRequest  |  待续  |
89 90 91

### 参考图例

智布道's avatar
智布道 已提交
92
##### 授权Gitee
93

智布道's avatar
智布道 已提交
94
![Gitee授权登录](https://images.gitee.com/uploads/images/2019/0221/140015_4c09610e_784199.png "Gitee授权登录")
95

智布道's avatar
智布道 已提交
96
##### 授权Github
97

智布道's avatar
智布道 已提交
98
![Github授权登录](https://images.gitee.com/uploads/images/2019/0221/140032_58f7dfb5_784199.png "Github授权登录")
99

智布道's avatar
智布道 已提交
100
##### 授权钉钉
101

智布道's avatar
智布道 已提交
102 103
![钉钉授权登录](https://images.gitee.com/uploads/images/2019/0221/140540_8da8d959_784199.jpeg "钉钉授权登录")

104

智布道's avatar
智布道 已提交
105
##### 授权百度
106

智布道's avatar
智布道 已提交
107 108
![百度授权登录](https://images.gitee.com/uploads/images/2019/0221/140607_ebf1dcb6_784199.png "百度授权登录")

智布道's avatar
智布道 已提交
109
##### 授权Weibo
智布道's avatar
智布道 已提交
110

智布道's avatar
智布道 已提交
111
![微博授权登录](https://images.gitee.com/uploads/images/2019/0222/191210_67d5597c_784199.png "微博授权登录")
112

智布道's avatar
智布道 已提交
113
##### 授权CSDN
114 115 116

待续

智布道's avatar
智布道 已提交
117
##### 授权微信
118 119

待续
智布道's avatar
智布道 已提交
120

智布道's avatar
智布道 已提交
121
##### 授权QQ
智布道's avatar
智布道 已提交
122 123 124

待续