Merge remote-tracking branch 'origin/DWN-37025_openIdServer' into 1.3.x
commit
689f38e096
|
@ -85,7 +85,9 @@
|
||||||
<c:if test="${ not empty client.logoUri }">
|
<c:if test="${ not empty client.logoUri }">
|
||||||
<ul class="thumbnails">
|
<ul class="thumbnails">
|
||||||
<li class="span5">
|
<li class="span5">
|
||||||
<a class="thumbnail" data-toggle="modal" data-target="#logoModal"><img src="api/clients/${ client.id }/logo" /></a>
|
<a class="thumbnail" data-toggle="modal" data-target="#logoModal">
|
||||||
|
<img src="<c:out value="${ client.logoUri }" />" referrerpolicy="no-referrer" />
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
|
@ -104,7 +106,7 @@
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<img src="api/clients/${ client.id }/logo" />
|
<img src="<c:out value="${ client.logoUri }" />" referrerpolicy="no-referrer" />
|
||||||
<c:if test="${ not empty client.clientUri }">
|
<c:if test="${ not empty client.clientUri }">
|
||||||
<a href="<c:out value="${ client.clientUri }" />"><c:out value="${ client.clientUri }" /></a>
|
<a href="<c:out value="${ client.clientUri }" />"><c:out value="${ client.clientUri }" /></a>
|
||||||
</c:if>
|
</c:if>
|
||||||
|
|
|
@ -85,7 +85,9 @@
|
||||||
<c:if test="${ not empty client.logoUri }">
|
<c:if test="${ not empty client.logoUri }">
|
||||||
<ul class="thumbnails">
|
<ul class="thumbnails">
|
||||||
<li class="span5">
|
<li class="span5">
|
||||||
<a class="thumbnail" data-toggle="modal" data-target="#logoModal"><img src="api/clients/${ client.id }/logo" /></a>
|
<a class="thumbnail" data-toggle="modal" data-target="#logoModal">
|
||||||
|
<img src="<c:out value="${ client.logoUri }" />" referrerpolicy="no-referrer" />
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
|
@ -104,7 +106,7 @@
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<img src="api/clients/${ client.id }/logo" />
|
<img src="<c:out value="${ client.logoUri }" />" referrerpolicy="no-referrer" />
|
||||||
<c:if test="${ not empty client.clientUri }">
|
<c:if test="${ not empty client.clientUri }">
|
||||||
<a href="<c:out value="${ client.clientUri }" />"><c:out value="${ client.clientUri }" /></a>
|
<a href="<c:out value="${ client.clientUri }" />"><c:out value="${ client.clientUri }" /></a>
|
||||||
</c:if>
|
</c:if>
|
||||||
|
|
|
@ -26,7 +26,9 @@
|
||||||
|
|
||||||
<div class="media">
|
<div class="media">
|
||||||
<% if (client.logoUri) { %>
|
<% if (client.logoUri) { %>
|
||||||
<span class="pull-left"><img class="media-object client-logo" src="api/clients/<%- client.id %>/logo"></span>
|
<span class="pull-left">
|
||||||
|
<img class="media-object client-logo" src="<%- client.logoUri %>" referrerpolicy="no-referrer" />
|
||||||
|
</span>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
|
|
|
@ -133,9 +133,6 @@ public class ClientAPI {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ClientDetailsEntityService clientService;
|
private ClientDetailsEntityService clientService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ClientLogoLoadingService clientLogoLoadingService;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@Qualifier("clientAssertionValidator")
|
@Qualifier("clientAssertionValidator")
|
||||||
private AssertionValidator assertionValidator;
|
private AssertionValidator assertionValidator;
|
||||||
|
@ -519,31 +516,6 @@ public class ClientAPI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the logo image for a client
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "/{id}/logo", method=RequestMethod.GET, produces = { MediaType.IMAGE_GIF_VALUE, MediaType.IMAGE_JPEG_VALUE, MediaType.IMAGE_PNG_VALUE })
|
|
||||||
public ResponseEntity<byte[]> getClientLogo(@PathVariable("id") Long id, Model model) {
|
|
||||||
|
|
||||||
ClientDetailsEntity client = clientService.getClientById(id);
|
|
||||||
|
|
||||||
if (client == null) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
|
||||||
} else if (Strings.isNullOrEmpty(client.getLogoUri())) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
|
||||||
} else {
|
|
||||||
// get the image from cache
|
|
||||||
CachedImage image = clientLogoLoadingService.getLogo(client);
|
|
||||||
|
|
||||||
HttpHeaders headers = new HttpHeaders();
|
|
||||||
headers.setContentType(MediaType.parseMediaType(image.getContentType()));
|
|
||||||
headers.setContentLength(image.getLength());
|
|
||||||
|
|
||||||
return new ResponseEntity<>(image.getData(), headers, HttpStatus.OK);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private ClientDetailsEntity validateSoftwareStatement(ClientDetailsEntity newClient) throws ValidationException {
|
private ClientDetailsEntity validateSoftwareStatement(ClientDetailsEntity newClient) throws ValidationException {
|
||||||
if (newClient.getSoftwareStatement() != null) {
|
if (newClient.getSoftwareStatement() != null) {
|
||||||
if (assertionValidator.isValid(newClient.getSoftwareStatement())) {
|
if (assertionValidator.isValid(newClient.getSoftwareStatement())) {
|
||||||
|
|
|
@ -150,6 +150,7 @@ public class DynamicClientRegistrationEndpoint {
|
||||||
* @param p
|
* @param p
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@PreAuthorize("hasRole('ROLE_USER')")
|
||||||
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public String registerNewClient(@RequestBody String jsonString, Model m) {
|
public String registerNewClient(@RequestBody String jsonString, Model m) {
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,7 @@ public class ProtectedResourceRegistrationEndpoint {
|
||||||
* @param p
|
* @param p
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@PreAuthorize("hasRole('ROLE_USER')")
|
||||||
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public String registerNewProtectedResource(@RequestBody String jsonString, Model m) {
|
public String registerNewProtectedResource(@RequestBody String jsonString, Model m) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue