コード例 #1
0
ファイル: MongoScopeStore.java プロジェクト: ahus1/keycloak
  @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);
  }
コード例 #2
0
  @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);
  }