MCPcopy
hub / github.com/justauth/JustAuth / AuthSource

Interface AuthSource

src/main/java/me/zhyd/oauth/config/AuthSource.java:25–84  ·  view source on GitHub ↗

OAuth平台的API地址的统一接口,提供以下方法: 1) AuthSource#authorize(): 获取授权url. 必须实现 2) AuthSource#accessToken(): 获取accessToken的url. 必须实现 3) AuthSource#userInfo(): 获取用户信息的url. 必须实现 4) AuthSource#revoke(): 获取取消授权的url. 非必须实现接口(部分平台不支持) 5) AuthSource#refresh(): 获取刷新授权的url. 非必须实现接

Source from the content-addressed store, hash-verified

23 * @since 1.12.0
24 */
25public interface AuthSource {
26
27 /**
28 * 授权的api
29 *
30 * @return url
31 */
32 String authorize();
33
34 /**
35 * 获取accessToken的api
36 *
37 * @return url
38 */
39 String accessToken();
40
41 /**
42 * 获取用户信息的api
43 *
44 * @return url
45 */
46 String userInfo();
47
48 /**
49 * 取消授权的api
50 *
51 * @return url
52 */
53 default String revoke() {
54 throw new AuthException(AuthResponseStatus.UNSUPPORTED);
55 }
56
57 /**
58 * 刷新授权的api
59 *
60 * @return url
61 */
62 default String refresh() {
63 throw new AuthException(AuthResponseStatus.UNSUPPORTED);
64 }
65
66 /**
67 * 获取Source的字符串名字
68 *
69 * @return name
70 */
71 default String getName() {
72 if (this instanceof Enum) {
73 return String.valueOf(this);
74 }
75 return this.getClass().getSimpleName();
76 }
77
78 /**
79 * 平台对应的 AuthRequest 实现类,必须继承自 {@link AuthDefaultRequest}
80 *
81 * @return class
82 */

Callers 29

testUrlBuilderMethod · 0.65
authorizeMethod · 0.65
loginMethod · 0.65
getAccessTokenMethod · 0.65
refreshMethod · 0.65
getAccessTokenMethod · 0.65
accessTokenUrlMethod · 0.65
getAccessTokenMethod · 0.65
getAuthTokenMethod · 0.65
getTokenMethod · 0.65

Implementers 2

AuthExtendSourcesrc/test/java/me/zhyd/oauth/config/Aut
AuthDefaultSourcesrc/main/java/me/zhyd/oauth/config/Aut

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…