From 780839dbf9319f19c3fb5b9586ebbd501c687e2d Mon Sep 17 00:00:00 2001 From: Amanda Anganes Date: Wed, 8 Aug 2012 09:55:44 -0400 Subject: [PATCH] Made things compile after ClientDetailsEntity refactoring --- .../mitre/oauth2/service/ClientDetailsEntityService.java | 2 +- .../impl/DefaultOAuth2ClientDetailsEntityService.java | 7 ++++--- .../main/java/org/mitre/openid/connect/web/ClientAPI.java | 6 ++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/openid-connect-common/src/main/java/org/mitre/oauth2/service/ClientDetailsEntityService.java b/openid-connect-common/src/main/java/org/mitre/oauth2/service/ClientDetailsEntityService.java index c515004c2..514f4f373 100644 --- a/openid-connect-common/src/main/java/org/mitre/oauth2/service/ClientDetailsEntityService.java +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/service/ClientDetailsEntityService.java @@ -27,7 +27,7 @@ public interface ClientDetailsEntityService extends ClientDetailsService { public ClientDetailsEntity loadClientByClientId(String clientId) throws OAuth2Exception; - public ClientDetailsEntity createClient(String clientId, String clientSecret, Set scope, Set grantTypes, String redirectUri, Set authorities, Set resourceIds, String name, String description, boolean allowRefresh, Integer accessTokenTimeout, Integer refreshTokenTimeout, String owner); + public ClientDetailsEntity createClient(String clientId, String clientSecret, Set scope, Set grantTypes, String redirectUri, Set authorities, Set resourceIds, String name, String description, boolean allowRefresh, Integer accessTokenTimeout, Integer refreshTokenTimeout, Set contacts); public ClientDetailsEntity createClient(ClientDetailsEntity client); diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ClientDetailsEntityService.java b/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ClientDetailsEntityService.java index 2bb39f505..df9870e55 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ClientDetailsEntityService.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ClientDetailsEntityService.java @@ -33,6 +33,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.google.common.base.Strings; +import com.google.common.collect.Sets; @Service @Transactional @@ -84,7 +85,7 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt Set scope, Set grantTypes, String redirectUri, Set authorities, Set resourceIds, String name, String description, boolean allowRefresh, Integer accessTokenTimeout, - Integer refreshTokenTimeout, String owner) { + Integer refreshTokenTimeout, Set contacts) { // TODO: check "owner" locally? @@ -96,13 +97,13 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt redirectUris.add(redirectUri); client.setRegisteredRedirectUri(redirectUris); client.setAuthorities(authorities); - client.setClientName(name); + client.setApplicationName(name); client.setClientDescription(description); client.setAllowRefresh(allowRefresh); client.setAccessTokenValiditySeconds(accessTokenTimeout); client.setRefreshTokenValiditySeconds(refreshTokenTimeout); client.setResourceIds(resourceIds); - client.setOwner(owner); + client.setContacts(contacts); clientRepository.saveClient(client); diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ClientAPI.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ClientAPI.java index 9dc502d38..a0b5155dc 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ClientAPI.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ClientAPI.java @@ -66,7 +66,8 @@ public class ClientAPI { ClientDetailsEntity client = new Gson().fromJson(json, ClientDetailsEntity.class); // set owners as current logged in user - client.setOwner(principal.getName()); + //client.setOwner(principal.getName()); + //TODO: owner has been replaced by a list of contacts, which should be styled as email addresses. m.addAttribute("entity", clientService.saveClient(client)); return "jsonClientView"; @@ -78,7 +79,8 @@ public class ClientAPI { ClientDetailsEntity client = new Gson().fromJson(json, ClientDetailsEntity.class); client.setClientId(id); // set owners as current logged in user - client.setOwner(principal.getName()); + // client.setOwner(principal.getName()); + //TODO: owner has been replaced by a list of contacts, which should be styled as email addresses. m.addAttribute("entity", clientService.saveClient(client));