1
|
package eu.dnetlib.openaire.usermanagement;
|
2
|
|
3
|
import com.google.gson.Gson;
|
4
|
import com.google.gson.GsonBuilder;
|
5
|
|
6
|
public class ServiceRequest {
|
7
|
String clientName;
|
8
|
String clientId;
|
9
|
String[] redirectUris = new String[]{};
|
10
|
String clientDescription;
|
11
|
String logoUri;
|
12
|
String policyUri;
|
13
|
String[] contacts;
|
14
|
String[] scope = new String[]{"orcid", "openid", "email", "eduperson_entitlement", "profile", "offline_access"};
|
15
|
String[] grantTypes = new String[] {"client_credentials"};
|
16
|
boolean allowIntrospection = true;
|
17
|
String tokenEndpointAuthMethod = "PRIVATE KEY";
|
18
|
String tokenEndpointAuthSigningAlg = "RS256";
|
19
|
String jwksType = "VAL";
|
20
|
String jwksUri;
|
21
|
Jwks jwks = new Jwks();
|
22
|
boolean allowRefresh = false;
|
23
|
boolean reuseRefreshToken = true;
|
24
|
boolean clearAccessTokensOnRefresh = true;
|
25
|
|
26
|
public String getClientName() {
|
27
|
return clientName;
|
28
|
}
|
29
|
|
30
|
public void setClientName(String clientName) {
|
31
|
this.clientName = clientName;
|
32
|
}
|
33
|
|
34
|
public String getClientId() {
|
35
|
return clientId;
|
36
|
}
|
37
|
|
38
|
public void setClientId(String clientId) {
|
39
|
this.clientId = clientId;
|
40
|
}
|
41
|
|
42
|
public String[] getRedirectUris() {
|
43
|
return redirectUris;
|
44
|
}
|
45
|
|
46
|
public void setRedirectUris(String[] redirectUris) {
|
47
|
this.redirectUris = redirectUris;
|
48
|
}
|
49
|
|
50
|
public String getClientDescription() {
|
51
|
return clientDescription;
|
52
|
}
|
53
|
|
54
|
public void setClientDescription(String clientDescription) {
|
55
|
this.clientDescription = clientDescription;
|
56
|
}
|
57
|
|
58
|
public String getLogoUri() {
|
59
|
return logoUri;
|
60
|
}
|
61
|
|
62
|
public void setLogoUri(String logoUri) {
|
63
|
this.logoUri = logoUri;
|
64
|
}
|
65
|
|
66
|
public String getPolicyUri() {
|
67
|
return policyUri;
|
68
|
}
|
69
|
|
70
|
public void setPolicyUri(String policyUri) {
|
71
|
this.policyUri = policyUri;
|
72
|
}
|
73
|
|
74
|
public String[] getContacts() {
|
75
|
return contacts;
|
76
|
}
|
77
|
|
78
|
public void setContacts(String[] contacts) {
|
79
|
this.contacts = contacts;
|
80
|
}
|
81
|
|
82
|
public String[] getScope() {
|
83
|
return scope;
|
84
|
}
|
85
|
|
86
|
public void setScope(String[] scope) {
|
87
|
this.scope = scope;
|
88
|
}
|
89
|
|
90
|
public String[] getGrantTypes() {
|
91
|
return grantTypes;
|
92
|
}
|
93
|
|
94
|
public void setGrantTypes(String[] grantTypes) {
|
95
|
this.grantTypes = grantTypes;
|
96
|
}
|
97
|
|
98
|
public boolean isAllowIntrospection() {
|
99
|
return allowIntrospection;
|
100
|
}
|
101
|
|
102
|
public void setAllowIntrospection(boolean allowIntrospection) {
|
103
|
this.allowIntrospection = allowIntrospection;
|
104
|
}
|
105
|
|
106
|
public String getTokenEndpointAuthMethod() {
|
107
|
return tokenEndpointAuthMethod;
|
108
|
}
|
109
|
|
110
|
public void setTokenEndpointAuthMethod(String tokenEndpointAuthMethod) {
|
111
|
this.tokenEndpointAuthMethod = tokenEndpointAuthMethod;
|
112
|
}
|
113
|
|
114
|
public String getTokenEndpointAuthSigningAlg() {
|
115
|
return tokenEndpointAuthSigningAlg;
|
116
|
}
|
117
|
|
118
|
public void setTokenEndpointAuthSigningAlg(String tokenEndpointAuthSigningAlg) {
|
119
|
this.tokenEndpointAuthSigningAlg = tokenEndpointAuthSigningAlg;
|
120
|
}
|
121
|
|
122
|
public String getJwksType() {
|
123
|
return jwksType;
|
124
|
}
|
125
|
|
126
|
public void setJwksType(String jwksType) {
|
127
|
this.jwksType = jwksType;
|
128
|
}
|
129
|
|
130
|
public String getJwksUri() {
|
131
|
return jwksUri;
|
132
|
}
|
133
|
|
134
|
public void setJwksUri(String jwksUri) {
|
135
|
this.jwksUri = jwksUri;
|
136
|
}
|
137
|
|
138
|
public static void main(String[] args) {
|
139
|
|
140
|
GsonBuilder builder = new GsonBuilder();
|
141
|
builder.serializeNulls();
|
142
|
|
143
|
Gson gson = builder.create();
|
144
|
String json = gson.toJson(new ServiceRequest());
|
145
|
System.out.println(json);
|
146
|
|
147
|
}
|
148
|
}
|
149
|
class Jwks {
|
150
|
Key[] keys = new Key[]{new Key()};
|
151
|
}
|
152
|
|
153
|
class Key {
|
154
|
String kty = "RSA";
|
155
|
String e = "AQAB";
|
156
|
String kid = "05794a3c-a6f5-430c-9822-da4e53597ba5";
|
157
|
String alg = "RS256";
|
158
|
String n = "hm_OUny05OJEwbGBqPjE7wWvnwTMgqUHJFis_S9nM7hTivXQ_LX9f89RaVcPpXboox81Y8rrfuVwV0nc-FGr_" +
|
159
|
"E0FFpI-IwJ_sUUEDwf-5Qxor3LNc_S_5BiPOfFHY7c-R-ablRIAvVTXqwIjcyLVQnaHLjb9XQPf9lBt9sCZ2jN-" +
|
160
|
"9HOLztMO3BZWZYIFqvNr8ySKHfVPdlk0Wx3N45KPY0kgxk5RPYW0HLRakSlhIJtqYCJOr2IiDUEMAj9Z9BoWjeUKiAX3E3ZRo-" +
|
161
|
"DO1TWcc7feq-0Pei2IBw3lvNpgcBBv1_BlrsZYzQqkKOcDbLAppuhR3inUNhc3G67OuWt8ow";
|
162
|
}
|
163
|
|
164
|
|