-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Home
yadong.zhang edited this page Jul 5, 2019
·
2 revisions
Login, so easy.
JustAuth,如你所见,它仅仅是一个第三方授权登录的工具类库,它可以让我们脱离繁琐的第三方登录SDK,让登录变得So easy!
废话不多说,就俩字:
- 全:已集成十多家第三方平台(国内外常用的基本都已包含),后续依然还有扩展计划!
-
简:API就是奔着最简单去设计的(见后面
快速开始),尽量让您用起来没有障碍感!
- 引入依赖
<dependency> <groupId>me.zhyd.oauth</groupId> <artifactId>JustAuth</artifactId> <version>1.7.0</version> </dependency>
- 调用api
// 创建授权request AuthRequest authRequest = new AuthGiteeRequest(AuthConfig.builder() .clientId("clientId") .clientSecret("clientSecret") .redirectUri("redirectUri") .build()); // 生成授权页面 authRequest.authorize(); // 授权登录后会返回一个code,用这个code进行登录 authRequest.login("code");
配套Demo:JustAuth-demo
具体的例子可以参考: