Project

General

Profile

1
package eu.dnetlib.openaire.usermanagement;
2

    
3
import com.google.gson.Gson;
4
import com.google.gson.GsonBuilder;
5

    
6
import java.io.Serializable;
7

    
8
public class ServiceRequest {
9
    String clientName;
10
    String clientId;
11
    String[] redirectUris = new String[]{};
12
    String clientDescription;
13
    String logoUri;
14
    String policyUri;
15
    String[] contacts;
16
    String[] scope = new String[]{"orcid", "openid", "email",  "eduperson_entitlement",  "profile",  "offline_access"};
17
    String[] grantTypes = new String[] {"client_credentials"};
18
    boolean allowIntrospection = true;
19
    String tokenEndpointAuthMethod = "PRIVATE KEY";
20
    String tokenEndpointAuthSigningAlg = "RS256";
21
    String jwksType = "VAL";
22
    String jwksUri;
23
    Jwks jwks = new Jwks();
24
    boolean allowRefresh = false;
25
    boolean reuseRefreshToken = true;
26
    boolean clearAccessTokensOnRefresh = true;
27

    
28
    public String getClientName() {
29
        return clientName;
30
    }
31

    
32
    public void setClientName(String clientName) {
33
        this.clientName = clientName;
34
    }
35

    
36
    public String getClientId() {
37
        return clientId;
38
    }
39

    
40
    public void setClientId(String clientId) {
41
        this.clientId = clientId;
42
    }
43

    
44
    public String[] getRedirectUris() {
45
        return redirectUris;
46
    }
47

    
48
    public void setRedirectUris(String[] redirectUris) {
49
        this.redirectUris = redirectUris;
50
    }
51

    
52
    public String getClientDescription() {
53
        return clientDescription;
54
    }
55

    
56
    public void setClientDescription(String clientDescription) {
57
        this.clientDescription = clientDescription;
58
    }
59

    
60
    public String getLogoUri() {
61
        return logoUri;
62
    }
63

    
64
    public void setLogoUri(String logoUri) {
65
        this.logoUri = logoUri;
66
    }
67

    
68
    public String getPolicyUri() {
69
        return policyUri;
70
    }
71

    
72
    public void setPolicyUri(String policyUri) {
73
        this.policyUri = policyUri;
74
    }
75

    
76
    public String[] getContacts() {
77
        return contacts;
78
    }
79

    
80
    public void setContacts(String[] contacts) {
81
        this.contacts = contacts;
82
    }
83

    
84
    public String[] getScope() {
85
        return scope;
86
    }
87

    
88
    public void setScope(String[] scope) {
89
        this.scope = scope;
90
    }
91

    
92
    public String[] getGrantTypes() {
93
        return grantTypes;
94
    }
95

    
96
    public void setGrantTypes(String[] grantTypes) {
97
        this.grantTypes = grantTypes;
98
    }
99

    
100
    public boolean isAllowIntrospection() {
101
        return allowIntrospection;
102
    }
103

    
104
    public void setAllowIntrospection(boolean allowIntrospection) {
105
        this.allowIntrospection = allowIntrospection;
106
    }
107

    
108
    public String getTokenEndpointAuthMethod() {
109
        return tokenEndpointAuthMethod;
110
    }
111

    
112
    public void setTokenEndpointAuthMethod(String tokenEndpointAuthMethod) {
113
        this.tokenEndpointAuthMethod = tokenEndpointAuthMethod;
114
    }
115

    
116
    public String getTokenEndpointAuthSigningAlg() {
117
        return tokenEndpointAuthSigningAlg;
118
    }
119

    
120
    public void setTokenEndpointAuthSigningAlg(String tokenEndpointAuthSigningAlg) {
121
        this.tokenEndpointAuthSigningAlg = tokenEndpointAuthSigningAlg;
122
    }
123

    
124
    public String getJwksType() {
125
        return jwksType;
126
    }
127

    
128
    public void setJwksType(String jwksType) {
129
        this.jwksType = jwksType;
130
    }
131

    
132
    public String getJwksUri() {
133
        return jwksUri;
134
    }
135

    
136
    public void setJwksUri(String jwksUri) {
137
        this.jwksUri = jwksUri;
138
    }
139

    
140
    public static void main(String[] args) {
141

    
142
        GsonBuilder builder = new GsonBuilder();
143
        builder.serializeNulls();
144

    
145
        Gson gson = builder.create();
146
        String json = gson.toJson(new ServiceRequest());
147
        System.out.println(json);
148

    
149
    }
150
}
151

    
152
class Jwks implements Serializable {
153
    Key[] keys = new Key[]{new Key()};
154
}
155

    
156
class Key implements Serializable {
157
 /*   String kty;
158
    String e;
159
    String kid;
160
    String alg;
161
    String n;
162

    
163
    public String getKty() {
164
        return kty;
165
    }
166

    
167
    public void setKty(String kty) {
168
        this.kty = kty;
169
    }
170

    
171
    public String getE() {
172
        return e;
173
    }
174

    
175
    public void setE(String e) {
176
        this.e = e;
177
    }
178

    
179
    public String getKid() {
180
        return kid;
181
    }
182

    
183
    public void setKid(String kid) {
184
        this.kid = kid;
185
    }
186

    
187
    public String getAlg() {
188
        return alg;
189
    }
190

    
191
    public void setAlg(String alg) {
192
        this.alg = alg;
193
    }
194

    
195
    public String getN() {
196
        return n;
197
    }
198

    
199
    public void setN(String n) {
200
        this.n = n;
201
    }
202
*/
203

    
204
    String kty = "RSA";
205
    String e = "AQAB";
206
    String kid = "05794a3c-a6f5-430c-9822-da4e53597ba5";
207
    String alg = "RS256";
208
    String n = "hm_OUny05OJEwbGBqPjE7wWvnwTMgqUHJFis_S9nM7hTivXQ_LX9f89RaVcPpXboox81Y8rrfuVwV0nc-FGr_" +
209
                    "E0FFpI-IwJ_sUUEDwf-5Qxor3LNc_S_5BiPOfFHY7c-R-ablRIAvVTXqwIjcyLVQnaHLjb9XQPf9lBt9sCZ2jN-" +
210
                        "9HOLztMO3BZWZYIFqvNr8ySKHfVPdlk0Wx3N45KPY0kgxk5RPYW0HLRakSlhIJtqYCJOr2IiDUEMAj9Z9BoWjeUKiAX3E3ZRo-" +
211
                            "DO1TWcc7feq-0Pei2IBw3lvNpgcBBv1_BlrsZYzQqkKOcDbLAppuhR3inUNhc3G67OuWt8ow";
212
}
213

    
214

    
(14-14/17)