Merge pull request #405 from patriot1burke/master
redirect uris not required with bearer only
This commit is contained in:
commit
a22aa8055f
5 changed files with 10 additions and 6 deletions
|
@ -264,7 +264,7 @@ module.controller('ApplicationDetailCtrl', function($scope, realm, application,
|
||||||
|
|
||||||
$scope.save = function() {
|
$scope.save = function() {
|
||||||
if ($scope.create) {
|
if ($scope.create) {
|
||||||
if (!$scope.application.redirectUris || $scope.application.redirectUris.length == 0) {
|
if (!$scope.application.bearerOnly && (!$scope.application.redirectUris || $scope.application.redirectUris.length == 0)) {
|
||||||
Notifications.error("You must specify at least one redirect uri");
|
Notifications.error("You must specify at least one redirect uri");
|
||||||
} else {
|
} else {
|
||||||
Application.save({
|
Application.save({
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group" data-ng-show="!application.bearerOnly">
|
||||||
<label class="col-sm-2 control-label" for="baseUrl">Base URL</label>
|
<label class="col-sm-2 control-label" for="baseUrl">Base URL</label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<input class="form-control" type="text" name="baseUrl" id="baseUrl"
|
<input class="form-control" type="text" name="baseUrl" id="baseUrl"
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
data-ng-model="application.adminUrl">
|
data-ng-model="application.adminUrl">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group" data-ng-show="!application.bearerOnly">
|
||||||
<label class="col-sm-2 control-label" for="newWebOrigin">Web Origin</label>
|
<label class="col-sm-2 control-label" for="newWebOrigin">Web Origin</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div ng-repeat="webOrigin in application.webOrigins" class="row kc-item-deletable">
|
<div ng-repeat="webOrigin in application.webOrigins" class="row kc-item-deletable">
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class ApplicationResource {
|
||||||
|
|
||||||
@Path("claims")
|
@Path("claims")
|
||||||
public ClaimResource getClaimResource() {
|
public ClaimResource getClaimResource() {
|
||||||
return new ClaimResource(application);
|
return new ClaimResource(application, auth);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PUT
|
@PUT
|
||||||
|
|
|
@ -17,20 +17,24 @@ import javax.ws.rs.core.MediaType;
|
||||||
*/
|
*/
|
||||||
public class ClaimResource {
|
public class ClaimResource {
|
||||||
protected ClientModel model;
|
protected ClientModel model;
|
||||||
|
protected RealmAuth auth;
|
||||||
|
|
||||||
public ClaimResource(ClientModel model) {
|
public ClaimResource(ClientModel model, RealmAuth auth) {
|
||||||
this.model = model;
|
this.model = model;
|
||||||
|
this.auth = auth;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public ClaimRepresentation getClaims() {
|
public ClaimRepresentation getClaims() {
|
||||||
|
auth.requireView();
|
||||||
return ModelToRepresentation.toRepresentation(model);
|
return ModelToRepresentation.toRepresentation(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PUT
|
@PUT
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
public void updateClaims(ClaimRepresentation rep) {
|
public void updateClaims(ClaimRepresentation rep) {
|
||||||
|
auth.requireManage();
|
||||||
ClaimManager.setClaims(model, rep);
|
ClaimManager.setClaims(model, rep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class OAuthClientResource {
|
||||||
|
|
||||||
@Path("claims")
|
@Path("claims")
|
||||||
public ClaimResource getClaimResource() {
|
public ClaimResource getClaimResource() {
|
||||||
return new ClaimResource(oauthClient);
|
return new ClaimResource(oauthClient, auth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue