hejianhao
2026-08-28 16a57a8fc6868cea9171a1119698572407a2fc03
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package com.tcm.training.admin.app.auth.config;
 
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
 
/**
 * APP 苹果登录配置。
 */
@Component
@ConfigurationProperties(prefix = "app.auth.apple")
public class AppAppleAuthProperties {
 
    private String clientId = "";
    private String issuer = "https://appleid.apple.com";
    private String jwksUrl = "https://appleid.apple.com/auth/keys";
 
    /**
     * 获取苹果登录 clientId。
     */
    public String getClientId() {
        return clientId;
    }
 
    /**
     * 设置苹果登录 clientId。
     */
    public void setClientId(String clientId) {
        this.clientId = clientId;
    }
 
    /**
     * 获取苹果签发方。
     */
    public String getIssuer() {
        return issuer;
    }
 
    /**
     * 设置苹果签发方。
     */
    public void setIssuer(String issuer) {
        this.issuer = issuer;
    }
 
    /**
     * 获取苹果 JWKS 地址。
     */
    public String getJwksUrl() {
        return jwksUrl;
    }
 
    /**
     * 设置苹果 JWKS 地址。
     */
    public void setJwksUrl(String jwksUrl) {
        this.jwksUrl = jwksUrl;
    }
 
    /**
     * 判断是否已配置服务端验签所需参数。
     */
    public boolean isConfigured() {
        return hasText(clientId) && hasText(issuer) && hasText(jwksUrl);
    }
 
    /**
     * 判断字符串是否包含有效文本。
     */
    private boolean hasText(String value) {
        return value != null && !value.trim().isEmpty();
    }
}