Skip to content

Commit

Permalink
fix mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
patriot1burke committed Mar 2, 2015
1 parent 4361ce1 commit 6f88d50
Show file tree
Hide file tree
Showing 5 changed files with 311 additions and 307 deletions.
Expand Up @@ -28,6 +28,8 @@ public class DefaultMongoConnectionFactoryProvider implements MongoConnectionPro
"org.keycloak.models.mongo.keycloak.entities.MongoUserEntity",
"org.keycloak.models.mongo.keycloak.entities.MongoRoleEntity",
"org.keycloak.models.entities.IdentityProviderEntity",
"org.keycloak.models.entities.ClientIdentityProviderMappingEntity",
"org.keycloak.models.entities.ProtocolMapperEntity",
"org.keycloak.models.entities.RequiredCredentialEntity",
"org.keycloak.models.entities.CredentialEntity",
"org.keycloak.models.entities.FederatedIdentityEntity",
Expand Down
Expand Up @@ -23,7 +23,7 @@
public class ClientIdentityProviderMappingEntity {

private String id;
private Boolean retrieveToken;
private boolean retrieveToken;

public String getId() {
return this.id;
Expand All @@ -33,7 +33,7 @@ public void setId(String id) {
this.id = id;
}

public Boolean isRetrieveToken() {
public boolean isRetrieveToken() {
return this.retrieveToken;
}

Expand Down
Expand Up @@ -327,15 +327,14 @@ public void setProtocolMappers(Set<String> mapperIds) {
@Override
public void updateAllowedIdentityProviders(List<ClientIdentityProviderMappingModel> identityProviders) {
List<ClientIdentityProviderMappingEntity> stored = getMongoEntityAsClient().getIdentityProviders();

stored.clear();
for (ClientIdentityProviderMappingModel model : identityProviders) {
ClientIdentityProviderMappingEntity entity = new ClientIdentityProviderMappingEntity();

entity.setId(model.getIdentityProvider());
entity.setRetrieveToken(model.isRetrieveToken());
stored.add(entity);
}

getMongoEntityAsClient().setIdentityProviders(stored);
updateMongoEntity();
}

Expand Down
Expand Up @@ -910,7 +910,7 @@ protected ProtocolMapperModel entityToModel(ProtocolMapperEntity entity) {
mapping.setConsentRequired(entity.isConsentRequired());
mapping.setConsentText(entity.getConsentText());
Map<String, String> config = new HashMap<String, String>();
if (entity.getConfig() != null) config.putAll(config);
if (entity.getConfig() != null) config.putAll(entity.getConfig());
mapping.setConfig(config);
return mapping;
}
Expand Down

0 comments on commit 6f88d50

Please sign in to comment.