Skip to content

Commit 752336f

Browse files
committed
fix:紧急修复微信获取 token 解析失败问题
1 parent e439fab commit 752336f

37 files changed

+1797
-32
lines changed

src/main/java/cn/authing/sdk/java/client/AuthenticationClient.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,13 +1592,14 @@ public DecryptWechatMiniProgramDataRespDto decryptWechatMiniProgramData(
15921592
* @summary 获取微信小程序、公众号 Access Token
15931593
* @description 获取 Authing 服务器缓存的微信小程序、公众号 Access Token
15941594
**/
1595-
public GetWechatAccessTokenRespDto getWechatMpAccessToken(GetWechatAccessTokenDto reqDto) {
1595+
public GetWechatAccessTokenInfoRespDto getWechatMpAccessTokenInfo(
1596+
GetWechatAccessTokenDto reqDto) {
15961597
AuthingRequestConfig config = new AuthingRequestConfig();
1597-
config.setUrl("/api/v3/get-wechat-access-token");
1598+
config.setUrl("/api/v3/get-wechat-access-token-info");
15981599
config.setBody(reqDto);
15991600
config.setMethod("POST");
16001601
String response = request(config);
1601-
return deserialize(response, GetWechatAccessTokenRespDto.class);
1602+
return deserialize(response, GetWechatAccessTokenInfoRespDto.class);
16021603
}
16031604

16041605
/**
@@ -2258,6 +2259,18 @@ public PreCheckCodeRespDto preCheckCode(PreCheckCodeDto reqDto) {
22582259
return deserialize(response, PreCheckCodeRespDto.class);
22592260
}
22602261

2262+
/**
2263+
*
2264+
**/
2265+
public GetWechatAccessTokenRespDto getWechatMpAccessToken(GetWechatAccessTokenDto reqDto) {
2266+
AuthingRequestConfig config = new AuthingRequestConfig();
2267+
config.setUrl("/api/v3/get-wechat-access-token");
2268+
config.setBody(reqDto);
2269+
config.setMethod("POST");
2270+
String response = request(config);
2271+
return deserialize(response, GetWechatAccessTokenRespDto.class);
2272+
}
2273+
22612274
/**
22622275
*
22632276
**/

src/main/java/cn/authing/sdk/java/client/ManagementClient.java

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55

66
import cn.authing.sdk.java.model.AuthingRequestConfig;
77
import cn.authing.sdk.java.model.ManagementClientOptions;
8-
import java.util.HashMap;
9-
import java.util.Collections;
10-
import java.util.Map;
118

129

1310
public class ManagementClient extends BaseClient {
@@ -654,7 +651,7 @@ public UserDepartmentPaginatedRespDto getDepartmentList(GetMyDepartmentListDto r
654651
* @description 此接口用于获取用户被授权的资源列表。
655652
**/
656653
public AuthorizedResourcePaginatedRespDto getAuthorizedResources(
657-
GetAuthorizedResourcesDto reqDto) {
654+
GetMyAuthorizedResourcesDto reqDto) {
658655
AuthingRequestConfig config = new AuthingRequestConfig();
659656
config.setUrl("/api/v3/get-my-authorized-resources");
660657
config.setBody(reqDto);
@@ -1154,6 +1151,20 @@ public GetOtpSecretRespDto getOtpSecretByUser(GetOtpSecretByUserDto reqDto) {
11541151
return deserialize(response, GetOtpSecretRespDto.class);
11551152
}
11561153

1154+
/**
1155+
* @summary 获取用户自定义加密的密码
1156+
* @description 此功能主要是用户在控制台配置加基于 RSA、SM2 等加密的密钥后,加密用户的密码。
1157+
**/
1158+
public GetUserPasswordCiphertextRespDto getUserPasswordCiphertext(
1159+
GetUserPasswordCiphertextDto reqDto) {
1160+
AuthingRequestConfig config = new AuthingRequestConfig();
1161+
config.setUrl("/api/v3/get-user-password-ciphertext");
1162+
config.setBody(reqDto);
1163+
config.setMethod("POST");
1164+
String response = request(config);
1165+
return deserialize(response, GetUserPasswordCiphertextRespDto.class);
1166+
}
1167+
11571168
/**
11581169
* @summary 获取组织机构详情
11591170
* @description 获取组织机构详情
@@ -2406,6 +2417,61 @@ public ApplicationSingleRespDto getApplication(GetApplicationDto reqDto) {
24062417
return deserialize(response, ApplicationSingleRespDto.class);
24072418
}
24082419

2420+
/**
2421+
* @summary 主体授权详情
2422+
* @description 主体授权详情
2423+
**/
2424+
public GetSubjectAuthRespDto detailAuthSubject(GetSubjectAuthDetailDto reqDto) {
2425+
AuthingRequestConfig config = new AuthingRequestConfig();
2426+
config.setUrl("/api/v3/get-subject-auth-detail");
2427+
config.setBody(reqDto);
2428+
config.setMethod("GET");
2429+
String response = request(config);
2430+
return deserialize(response, GetSubjectAuthRespDto.class);
2431+
}
2432+
2433+
/**
2434+
* @summary 主体授权列表
2435+
* @description 主体授权列表
2436+
**/
2437+
public ListApplicationSubjectRespDto listAuthSubject(ListAuthSubjectDto reqDto) {
2438+
AuthingRequestConfig config = new AuthingRequestConfig();
2439+
config.setUrl("/api/v3/list-subject-auth");
2440+
config.setBody(reqDto);
2441+
config.setMethod("POST");
2442+
String response = request(config);
2443+
return deserialize(response, ListApplicationSubjectRespDto.class);
2444+
}
2445+
2446+
/**
2447+
* @summary 应用授权列表
2448+
* @description 应用授权列表
2449+
**/
2450+
public ListApplicationAuthPaginatedRespDto listAuthApplication(ListApplicationAuthDto reqDto) {
2451+
AuthingRequestConfig config = new AuthingRequestConfig();
2452+
config.setUrl("/api/v3/list-applications-auth");
2453+
config.setBody(reqDto);
2454+
config.setMethod("POST");
2455+
String response = request(config);
2456+
return deserialize(response, ListApplicationAuthPaginatedRespDto.class);
2457+
}
2458+
2459+
/**
2460+
* @summary 更新授权开关
2461+
* @description 更新授权开关
2462+
**/
2463+
public IsSuccessRespDto enabledAuth(UpdateAuthEnabledDto reqDto) {
2464+
AuthingRequestConfig config = new AuthingRequestConfig();
2465+
config.setUrl("/api/v3/update-auth-enabled");
2466+
config.setBody(reqDto);
2467+
config.setMethod("POST");
2468+
String response = request(config);
2469+
return deserialize(response, IsSuccessRespDto.class);
2470+
}
2471+
/**
2472+
* @summary 批量删除应用授权
2473+
* @description 批量删除应用授权
2474+
**/
24092475
/**
24102476
* @summary 获取应用列表
24112477
* @description 获取应用列表
@@ -4418,6 +4484,7 @@ public PubEventRespDto pubUserEvent(PubEventDto reqDto) {
44184484
return deserialize(response, PubEventRespDto.class);
44194485
}
44204486

4487+
44214488
/**
44224489
* @summary 获取推送登录请求关联的客户端应用
44234490
* @description 此端点用于在 Authing 令牌 APP 收到推送登录通知时,可检查当前用户登录的应用是否支持对推送登录请求进行授权。

src/main/java/cn/authing/sdk/java/dto/ApplicationEnabledExtIdpConnDto.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,12 @@ public static enum ExtIdpType {
215215

216216
@JsonProperty("aws")
217217
AWS("aws"),
218+
219+
@JsonProperty("douyin")
220+
DOUYIN("douyin"),
221+
222+
@JsonProperty("kuaishou")
223+
KUAISHOU("kuaishou"),
218224
;
219225

220226
private String value;
@@ -296,6 +302,9 @@ public static enum ExtIdpConnType {
296302
@JsonProperty("github")
297303
GITHUB("github"),
298304

305+
@JsonProperty("github:mobile")
306+
GITHUB_MOBILE("github:mobile"),
307+
299308
@JsonProperty("qq")
300309
QQ("qq"),
301310

@@ -353,6 +362,9 @@ public static enum ExtIdpConnType {
353362
@JsonProperty("gitlab")
354363
GITLAB("gitlab"),
355364

365+
@JsonProperty("gitlab:mobile")
366+
GITLAB_MOBILE("gitlab:mobile"),
367+
356368
@JsonProperty("linkedin")
357369
LINKEDIN("linkedin"),
358370

@@ -371,6 +383,9 @@ public static enum ExtIdpConnType {
371383
@JsonProperty("gitee")
372384
GITEE("gitee"),
373385

386+
@JsonProperty("gitee:mobile")
387+
GITEE_MOBILE("gitee:mobile"),
388+
374389
@JsonProperty("instagram")
375390
INSTAGRAM("instagram"),
376391

@@ -389,8 +404,17 @@ public static enum ExtIdpConnType {
389404
@JsonProperty("xiaomi")
390405
XIAOMI("xiaomi"),
391406

407+
@JsonProperty("xiaomi:mobile")
408+
XIAOMI_MOBILE("xiaomi:mobile"),
409+
392410
@JsonProperty("aws")
393411
AWS("aws"),
412+
413+
@JsonProperty("douyin:mobile")
414+
DOUYIN_MOBILE("douyin:mobile"),
415+
416+
@JsonProperty("kuaishou:mobile")
417+
KUAISHOU_MOBILE("kuaishou:mobile"),
394418
;
395419

396420
private String value;

src/main/java/cn/authing/sdk/java/dto/CreateExtIdpConnDto.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ public static enum Type {
171171
@JsonProperty("github")
172172
GITHUB("github"),
173173

174+
@JsonProperty("github:mobile")
175+
GITHUB_MOBILE("github:mobile"),
176+
174177
@JsonProperty("qq")
175178
QQ("qq"),
176179

@@ -228,6 +231,9 @@ public static enum Type {
228231
@JsonProperty("gitlab")
229232
GITLAB("gitlab"),
230233

234+
@JsonProperty("gitlab:mobile")
235+
GITLAB_MOBILE("gitlab:mobile"),
236+
231237
@JsonProperty("linkedin")
232238
LINKEDIN("linkedin"),
233239

@@ -246,6 +252,9 @@ public static enum Type {
246252
@JsonProperty("gitee")
247253
GITEE("gitee"),
248254

255+
@JsonProperty("gitee:mobile")
256+
GITEE_MOBILE("gitee:mobile"),
257+
249258
@JsonProperty("instagram")
250259
INSTAGRAM("instagram"),
251260

@@ -264,8 +273,17 @@ public static enum Type {
264273
@JsonProperty("xiaomi")
265274
XIAOMI("xiaomi"),
266275

276+
@JsonProperty("xiaomi:mobile")
277+
XIAOMI_MOBILE("xiaomi:mobile"),
278+
267279
@JsonProperty("aws")
268280
AWS("aws"),
281+
282+
@JsonProperty("douyin:mobile")
283+
DOUYIN_MOBILE("douyin:mobile"),
284+
285+
@JsonProperty("kuaishou:mobile")
286+
KUAISHOU_MOBILE("kuaishou:mobile"),
269287
;
270288

271289
private String value;

src/main/java/cn/authing/sdk/java/dto/CreateExtIdpDto.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package cn.authing.sdk.java.dto;
22

3-
import java.util.List;
3+
44
import com.fasterxml.jackson.annotation.JsonProperty;
55

66

@@ -46,7 +46,7 @@ public void setTenantId(String tenantId) {
4646
/**
4747
* 身份源连接类型
4848
*/
49-
public static enum Type {
49+
public enum Type {
5050

5151
@JsonProperty("oidc")
5252
OIDC("oidc"),
@@ -143,6 +143,12 @@ public static enum Type {
143143

144144
@JsonProperty("aws")
145145
AWS("aws"),
146+
147+
@JsonProperty("douyin")
148+
DOUYIN("douyin"),
149+
150+
@JsonProperty("kuaishou")
151+
KUAISHOU("kuaishou"),
146152
;
147153

148154
private String value;

src/main/java/cn/authing/sdk/java/dto/CreateIdentityDto.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import java.util.List;
44
import com.fasterxml.jackson.annotation.JsonProperty;
55

6-
import cn.authing.sdk.java.dto.User;
76

87
public class CreateIdentityDto {
98
/**
@@ -260,6 +259,12 @@ public static enum Provider {
260259

261260
@JsonProperty("aws")
262261
AWS("aws"),
262+
263+
@JsonProperty("douyin")
264+
DOUYIN("douyin"),
265+
266+
@JsonProperty("kuaishou")
267+
KUAISHOU("kuaishou"),
263268
;
264269

265270
private String value;

src/main/java/cn/authing/sdk/java/dto/ExtIdpConnDetail.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ public static enum Type {
183183
@JsonProperty("github")
184184
GITHUB("github"),
185185

186+
@JsonProperty("github:mobile")
187+
GITHUB_MOBILE("github:mobile"),
188+
186189
@JsonProperty("qq")
187190
QQ("qq"),
188191

@@ -240,6 +243,9 @@ public static enum Type {
240243
@JsonProperty("gitlab")
241244
GITLAB("gitlab"),
242245

246+
@JsonProperty("gitlab:mobile")
247+
GITLAB_MOBILE("gitlab:mobile"),
248+
243249
@JsonProperty("linkedin")
244250
LINKEDIN("linkedin"),
245251

@@ -258,6 +264,9 @@ public static enum Type {
258264
@JsonProperty("gitee")
259265
GITEE("gitee"),
260266

267+
@JsonProperty("gitee:mobile")
268+
GITEE_MOBILE("gitee:mobile"),
269+
261270
@JsonProperty("instagram")
262271
INSTAGRAM("instagram"),
263272

@@ -276,8 +285,17 @@ public static enum Type {
276285
@JsonProperty("xiaomi")
277286
XIAOMI("xiaomi"),
278287

288+
@JsonProperty("xiaomi:mobile")
289+
XIAOMI_MOBILE("xiaomi:mobile"),
290+
279291
@JsonProperty("aws")
280292
AWS("aws"),
293+
294+
@JsonProperty("douyin:mobile")
295+
DOUYIN_MOBILE("douyin:mobile"),
296+
297+
@JsonProperty("kuaishou:mobile")
298+
KUAISHOU_MOBILE("kuaishou:mobile"),
281299
;
282300

283301
private String value;

src/main/java/cn/authing/sdk/java/dto/ExtIdpInfoDto.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,12 @@ public static enum Type {
227227

228228
@JsonProperty("aws")
229229
AWS("aws"),
230+
231+
@JsonProperty("douyin")
232+
DOUYIN("douyin"),
233+
234+
@JsonProperty("kuaishou")
235+
KUAISHOU("kuaishou"),
230236
;
231237

232238
private String value;

0 commit comments

Comments
 (0)