Revision 59756
Added by Katerina Iatropoulou about 4 years ago
modules/dnet-openaire-users/trunk/src/main/java/eu/dnetlib/openaire/usermanagement/ServiceRequest.java | ||
---|---|---|
13 | 13 |
String[] scope = new String[]{"openid"}; |
14 | 14 |
String[] grantTypes = new String[] {"client_credentials"}; |
15 | 15 |
boolean allowIntrospection = true; |
16 |
String tokenEndpointAuthMethod = "PRIVATE KEY";
|
|
16 |
String tokenEndpointAuthMethod = "PRIVATE_KEY";
|
|
17 | 17 |
String tokenEndpointAuthSigningAlg = "RS256"; |
18 | 18 |
String jwksType; |
19 | 19 |
String jwksUri; |
modules/dnet-openaire-users/trunk/src/main/java/eu/dnetlib/openaire/usermanagement/RegisterServiceServlet.java | ||
---|---|---|
126 | 126 |
|
127 | 127 |
} else { |
128 | 128 |
request.getSession().setAttribute("key_radio", "value"); |
129 |
Key key = serviceResponse.getJwks().keys[0]; |
|
129 |
Key key; |
|
130 |
if (serviceResponse.getJwks()!= null) { |
|
131 |
key = serviceResponse.getJwks().keys[0]; |
|
132 |
} else { |
|
133 |
key = new Key(); |
|
134 |
} |
|
130 | 135 |
System.out.println("Service response keys " + serviceResponse.getJwksUri()); |
131 | 136 |
Gson gson = new GsonBuilder().setPrettyPrinting().create(); |
132 | 137 |
request.getSession().setAttribute("value", gson.toJson(key)); |
... | ... | |
234 | 239 |
|
235 | 240 |
try { |
236 | 241 |
registeredServicesUtils.addRegistedService(registeredService); |
237 |
request.getSession().setAttribute("success", "Your service has been successfully registered!"); |
|
242 |
request.getSession().setAttribute("success", "Your service has been successfully registered!The id of your service is " + |
|
243 |
serviceResponse.getClientId()); |
|
238 | 244 |
|
239 | 245 |
} catch (SQLException sqle) { |
240 | 246 |
logger.error("Fail to save service.", sqle); |
... | ... | |
280 | 286 |
return; |
281 | 287 |
} |
282 | 288 |
|
283 |
request.getSession().setAttribute("success", "Your service with name '" + name + "' was successfully updated"); |
|
289 |
request.getSession().setAttribute("success", "Your service with name " + name + " was successfully updated.The id of your service " + |
|
290 |
"is " + serviceResponse.getClientId()); |
|
284 | 291 |
} |
285 | 292 |
|
286 | 293 |
} else { |
modules/dnet-openaire-users/trunk/src/main/java/eu/dnetlib/openaire/usermanagement/OverviewServlet.java | ||
---|---|---|
16 | 16 |
|
17 | 17 |
boolean isAuthenticated = !SecurityContextHolder.getContext().getAuthentication().getPrincipal().toString() |
18 | 18 |
.equals("anonymousUser"); |
19 |
System.out.println("Authenticated ? " + isAuthenticated); |
|
19 | 20 |
|
20 | 21 |
if (isAuthenticated) { |
21 | 22 |
OIDCAuthenticationToken authentication = (OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication(); |
modules/dnet-openaire-users/trunk/src/main/webapp/registerService.jsp | ||
---|---|---|
43 | 43 |
</div> |
44 | 44 |
<!-- CENTER SIDE --> |
45 | 45 |
<div class="uk-width-2-3@l uk-width-2-3@m"> |
46 |
>>>>>> ${param.id} |
|
47 | 46 |
<c:choose> |
48 | 47 |
<c:when test="${not empty param.id}"> |
49 | 48 |
<h4 class="uk-margin-remove-top uk-text-bold uk-text-primary">Edit service</h4> |
... | ... | |
169 | 168 |
<div class="uk-flex uk-flex-right uk-margin-medium-top"> |
170 | 169 |
<a type="submit" class="uk-button uk-button-default uk-margin-small-right" |
171 | 170 |
href="./registeredServices">Cancel</a> |
172 |
<button id="create" type="submit" class="uk-button uk-button-primary"> |
|
171 |
<button id="create" type="submit" class="uk-button uk-button-primary" onclick="return validate();">
|
|
173 | 172 |
<c:choose> |
174 | 173 |
<c:when test="${not empty param.id}"> |
175 | 174 |
Edit service |
... | ... | |
224 | 223 |
function validate() { |
225 | 224 |
var isValid = true; |
226 | 225 |
var create = $('#create'); |
227 |
//create.prop('disabled', true);
|
|
226 |
create.prop('disabled', true); |
|
228 | 227 |
var name = $("#first_name"); |
228 |
|
|
229 | 229 |
if (name.val() !== undefined) { |
230 | 230 |
if ($.trim(name.val()).length <= 0) { |
231 | 231 |
if (nameTouched) { |
232 | 232 |
name.addClass('uk-form-danger'); |
233 | 233 |
$("#first_name_error").show(); |
234 |
$("#first_name").get(0).scrollIntoView(); |
|
234 | 235 |
} |
235 | 236 |
isValid = false; |
236 | 237 |
} else { |
... | ... | |
270 | 271 |
} |
271 | 272 |
} |
272 | 273 |
if (isValid) { |
273 |
//create.prop('disabled', false);
|
|
274 |
create.prop('disabled', false); |
|
274 | 275 |
} |
275 | 276 |
return isValid; |
276 | 277 |
} |
modules/dnet-openaire-users/trunk/src/main/webapp/registeredServices.jsp | ||
---|---|---|
21 | 21 |
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"/> |
22 | 22 |
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> |
23 | 23 |
</head> |
24 |
<body class="" style=""> |
|
24 |
<body class="" style="" onload="success();">
|
|
25 | 25 |
<div class="uk-offcanvas-content uk-height-viewport"> |
26 | 26 |
<jsp:include page="header.jsp"/> |
27 | 27 |
<!-- CONTENT STARTS HERE --> |
... | ... | |
41 | 41 |
<div class="uk-grid" uk-grid> |
42 | 42 |
<div class="uk-width-expand@m"> |
43 | 43 |
<h4 class="uk-margin-remove-top uk-text-bold uk-text-primary">Registered services</h4> |
44 |
<c:if test="${success != null}"> |
|
45 |
<div class="uk-text-success uk-margin-small-bottom">${success}</div> |
|
46 |
<c:remove var="success" scope="session"/> |
|
47 |
</c:if> |
|
48 | 44 |
<c:if test="${message != null}"> |
49 | 45 |
<div class="uk-text-danger uk-margin-small-bottom">${message}</div> |
50 | 46 |
<c:remove var="message" scope="session"/> |
... | ... | |
87 | 83 |
<li> |
88 | 84 |
<div class="uk-grid uk-child-width-1-4 uk-text-muted" uk-grid> |
89 | 85 |
<div>Name</div> |
90 |
<div>id</div>
|
|
86 |
<div>Service Id</div>
|
|
91 | 87 |
<div>Creation Date</div> |
92 | 88 |
<div>Actions</div> |
93 | 89 |
</div> |
... | ... | |
164 | 160 |
</c:forEach> |
165 | 161 |
</ul> |
166 | 162 |
</c:if> |
167 |
</div> |
|
168 | 163 |
</div> |
169 | 164 |
<!-- END OF CENTER SIDE --> |
170 | 165 |
</div> |
171 | 166 |
</div> |
167 |
<script> |
|
168 |
function success() { |
|
169 |
if('${success}' !=='') |
|
170 |
UIkit.modal.confirm('${success}'); |
|
171 |
} |
|
172 |
</script> |
|
173 |
<c:remove var="success" scope="session"/> |
|
174 |
|
|
172 | 175 |
<!-- CONTENT ENDS HERE --> |
173 | 176 |
<c:import url="footer.jsp"/> |
174 | 177 |
</div> |
175 | 178 |
</body> |
176 | 179 |
</html> |
180 |
|
|
181 |
|
modules/dnet-openaire-users/trunk/src/main/webapp/overview.jsp | ||
---|---|---|
28 | 28 |
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" /> |
29 | 29 |
</head> |
30 | 30 |
<body class="" style=""> |
31 |
<div class="uk-offcanvas-content uk-height-viewport"> |
|
31 |
<div class="uk-offcanvas-content uk-height-viewport">Ï
|
|
32 | 32 |
<!-- MENU STARTS HERE --> |
33 |
<c:import url="header.jsp"/>
|
|
33 |
<jsp:include page="header.jsp"/>
|
|
34 | 34 |
<!-- CONTENT STARTS HERE --> |
35 | 35 |
<div class="first_page_section uk-section-default uk-section uk-padding-remove-vertical"> |
36 | 36 |
<div class="first_page_banner_headline uk-grid-collapse uk-flex-middle uk-margin-remove-vertical uk-grid" uk-grid=""> |
Also available in: Unified diff
Finalizing edit and create methods and forms