Beispiel #1
0
  @Override
  public Scope create(final String name, final ResourceServer resourceServer) {
    ScopeEntity entity = new ScopeEntity();

    entity.setId(KeycloakModelUtils.generateId());
    entity.setName(name);
    entity.setResourceServerId(resourceServer.getId());

    getMongoStore().insertEntity(entity, getInvocationContext());

    return new ScopeAdapter(entity, getInvocationContext(), this.authorizationProvider);
  }
  @Override
  public Policy create(String name, String type, ResourceServer resourceServer) {
    PolicyEntity entity = new PolicyEntity();

    entity.setId(KeycloakModelUtils.generateId());
    entity.setName(name);
    entity.setType(type);
    entity.setResourceServerId(resourceServer.getId());

    getMongoStore().insertEntity(entity, getInvocationContext());

    return new PolicyAdapter(entity, getInvocationContext(), this.authorizationProvider);
  }