redirect not required with bearer only
This commit is contained in:
parent
ebea9e9270
commit
f723ac79d1
5 changed files with 10 additions and 6 deletions
|
@ -264,7 +264,7 @@ module.controller('ApplicationDetailCtrl', function($scope, realm, application,
|
|||
|
||||
$scope.save = function() {
|
||||
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");
|
||||
} else {
|
||||
Application.save({
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
</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>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" name="baseUrl" id="baseUrl"
|
||||
|
@ -90,7 +90,7 @@
|
|||
data-ng-model="application.adminUrl">
|
||||
</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>
|
||||
<div class="col-sm-6">
|
||||
<div ng-repeat="webOrigin in application.webOrigins" class="row kc-item-deletable">
|
||||
|
|
|
@ -75,7 +75,7 @@ public class ApplicationResource {
|
|||
|
||||
@Path("claims")
|
||||
public ClaimResource getClaimResource() {
|
||||
return new ClaimResource(application);
|
||||
return new ClaimResource(application, auth);
|
||||
}
|
||||
|
||||
@PUT
|
||||
|
|
|
@ -17,20 +17,24 @@ import javax.ws.rs.core.MediaType;
|
|||
*/
|
||||
public class ClaimResource {
|
||||
protected ClientModel model;
|
||||
protected RealmAuth auth;
|
||||
|
||||
public ClaimResource(ClientModel model) {
|
||||
public ClaimResource(ClientModel model, RealmAuth auth) {
|
||||
this.model = model;
|
||||
this.auth = auth;
|
||||
}
|
||||
|
||||
@GET
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ClaimRepresentation getClaims() {
|
||||
auth.requireView();
|
||||
return ModelToRepresentation.toRepresentation(model);
|
||||
}
|
||||
|
||||
@PUT
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public void updateClaims(ClaimRepresentation rep) {
|
||||
auth.requireManage();
|
||||
ClaimManager.setClaims(model, rep);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ public class OAuthClientResource {
|
|||
|
||||
@Path("claims")
|
||||
public ClaimResource getClaimResource() {
|
||||
return new ClaimResource(oauthClient);
|
||||
return new ClaimResource(oauthClient, auth);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue