parent
8b1eef8ff9
commit
e225cbdc22
@ -0,0 +1,29 @@
|
||||
package com.luoo.user.dto.request;
|
||||
|
||||
import annotation.VerifyParam;
|
||||
import enums.VerifyRegexEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 期刊查询参数
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel
|
||||
public class AppleLoginReq implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String userIdentifier;
|
||||
private String identityToken;
|
||||
|
||||
private String givenName;
|
||||
private String familyName;
|
||||
private String email;
|
||||
private String authorizationCode;
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.luoo.user.util;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.junit.Test;
|
||||
|
||||
public class IOSLoginTest {
|
||||
@Test
|
||||
public void test() {
|
||||
// 请求的JWT
|
||||
// String identityToken = "eyJraWQiOiJlWGF1bm1MIiwiYWxnIjoiUlMyNTYifQ." +
|
||||
// "eyJpc3MiOiJodHRwczovL2FwcGxlaWQuYXBwbGUuY29tIiwiYXVkIjoiY29tLmRpeWl5aW4ub25saW5lNTMiLCJl" +
|
||||
// "eHAiOjE1OTc2NTAxNzQsImlhdCI6MTU5NzY0OTU3NCwic3ViIjoiMDAxMzc3LmQ0ZDVmMTAwODQ0ZTQzZjdiMWM1O" +
|
||||
// "WRiMzUyZWZkZmI4LjAyNTkiLCJjX2hhc2giOiJkTDVRdld2VTNjVHBxczNSazlUTnRBIiwiZW1haWwiOiI0OTk4O" +
|
||||
// "TY1MDdAcXEuY29tIiwiZW1haWxfdmVyaWZpZWQiOiJ0cnVlIiwiYXV0aF90aW1lIjoxNTk3NjQ5NTc0LCJub25jZV9" +
|
||||
// "zdXBwb3J0ZWQiOnRydWV9." +
|
||||
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LoDS7Erx3R-JYYHnCCWdLjh3bBC2wv_yUJkDs9OCBPxujVDu-YTCm9_VUKZNtfStAAIHRXD-8USI0NIVjd-AYPSU-3gRNdHPGPW0agnDwt5dkR9S96hkq1qDFDJokkFCO930_zw";
|
||||
// 解码后的消息体
|
||||
JSONObject playloadObj = IOSTokenUtils.parserIdentityToken(identityToken);
|
||||
Boolean success;
|
||||
try {
|
||||
success = IOSTokenUtils.verifyExc(identityToken, playloadObj);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
// TODO 校验token失败具体操作
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in new issue