This should be a working version with the AuthZ server deployed. I cleaned up a bunch of files that were generating compiler warnings. Changed use of GrantedAuthorithyImpl to SimpleGrantedAuthority, as GrantedAuthorityImpl is deprecated and SGA is its replacement.

Added stub for public OAuth2AccessToken readAccessToken(String accessToken) to DefaultOAuth2ProviderTokenService.java. This method IS in the superclass and should be implemented, but was not before and for some reason the compiler only started complaining about it now, on my machine.

Moved @Autowired for ClientDetailsEntityService in OAuthConfirmationController.java from setter method to field declaration, as it was failing to deploy on my machine in the other position. If others have issues with this change please let me know.
pull/59/head
Amanda Anganes 2012-03-15 12:13:50 -04:00
parent 9be02af93c
commit 0da11be4f9
22 changed files with 35 additions and 44 deletions

View File

@ -1,3 +1,4 @@
#Thu Mar 15 10:09:48 EDT 2012
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true

View File

@ -31,14 +31,8 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.core.springbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.springframework.ide.eclipse.core.springnature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>

View File

@ -4,7 +4,6 @@
package org.mitre.oauth2.model;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import javax.persistence.Basic;

View File

@ -1,6 +1,5 @@
package org.mitre.oauth2.model;
import org.mitre.oauth2.model.ClientDetailsEntity.ClientDetailsEntityBuilder;
public interface ClientDetailsEntityFactory {

View File

@ -1,11 +1,8 @@
package org.mitre.oauth2.repository;
import java.util.Collection;
import java.util.List;
import org.mitre.oauth2.model.ClientDetailsEntity;
import org.springframework.security.oauth2.provider.ClientDetails;
import org.springframework.stereotype.Repository;
public interface OAuth2ClientRepository {

View File

@ -1,7 +1,6 @@
package org.mitre.oauth2.service.impl;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import org.mitre.oauth2.model.ClientDetailsEntity;

View File

@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.security.oauth2.common.exceptions.InvalidClientException;
import org.springframework.security.oauth2.common.exceptions.InvalidTokenException;
import org.springframework.security.oauth2.provider.AuthorizationRequest;
@ -327,4 +328,10 @@ public class DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityServi
}
}
@Override
public OAuth2AccessToken readAccessToken(String accessToken) {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -1,7 +1,6 @@
package org.mitre.oauth2.web;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import org.mitre.oauth2.exception.ClientNotFoundException;
@ -13,7 +12,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.GrantedAuthorityImpl;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -22,7 +21,6 @@ import org.springframework.web.servlet.ModelAndView;
import com.google.common.base.Function;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@Controller
@ -74,7 +72,7 @@ public class OAuthClientAPI {
Iterables.transform(spaceDelimited.split(authorities), new Function<String, GrantedAuthority>() {
@Override
public GrantedAuthority apply(String auth) {
return new GrantedAuthorityImpl(auth);
return new SimpleGrantedAuthority(auth);
}
}));
logger.info("apiAddClient - printing client details");
@ -154,7 +152,7 @@ public class OAuthClientAPI {
Iterables.transform(spaceDelimited.split(authorities), new Function<String, GrantedAuthority>() {
@Override
public GrantedAuthority apply(String auth) {
return new GrantedAuthorityImpl(auth);
return new SimpleGrantedAuthority(auth);
}
}));
Set<String> resourceIdSet = Sets.newHashSet(spaceDelimited.split(resourceIds));

View File

@ -18,7 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.GrantedAuthorityImpl;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.oauth2.provider.AuthorizationRequest;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
@ -106,7 +106,7 @@ public class OAuthClientController {
public ModelAndView addClientPage(ModelAndView modelAndView) {
Set<GrantedAuthority> auth = Sets.newHashSet();
auth.add(new GrantedAuthorityImpl("ROLE_CLIENT"));
auth.add(new SimpleGrantedAuthority("ROLE_CLIENT"));
ClientDetailsEntity client = ClientDetailsEntity.makeBuilder()
.setScope(Sets.newHashSet("scope"))

View File

@ -23,6 +23,7 @@ import org.springframework.web.servlet.ModelAndView;
@SessionAttributes(types = AuthorizationRequest.class)
public class OAuthConfirmationController {
@Autowired
private ClientDetailsEntityService clientService;
public OAuthConfirmationController() {
@ -61,7 +62,6 @@ public class OAuthConfirmationController {
/**
* @param clientService the clientService to set
*/
@Autowired
public void setClientService(ClientDetailsEntityService clientService) {
this.clientService = clientService;
}

View File

@ -2,4 +2,9 @@ package org.mitre.openid.connect.exception;
public class ExpiredTokenException extends RuntimeException {
/**
*
*/
private static final long serialVersionUID = 1L;
}

View File

@ -2,4 +2,9 @@ package org.mitre.openid.connect.exception;
public class InvalidJwtIssuerException extends RuntimeException {
/**
*
*/
private static final long serialVersionUID = 1L;
}

View File

@ -2,4 +2,9 @@ package org.mitre.openid.connect.exception;
public class InvalidJwtSignatureException extends RuntimeException {
/**
*
*/
private static final long serialVersionUID = 1L;
}

View File

@ -4,7 +4,6 @@ import java.util.Date;
import org.mitre.openid.connect.model.IdToken;
import org.mitre.openid.connect.model.IdTokenClaims;
import org.mitre.util.Utility;
import org.springframework.stereotype.Service;
/**

View File

@ -7,7 +7,6 @@ import java.io.Writer;
import java.lang.reflect.Type;
import java.math.BigInteger;
import java.security.PublicKey;
import java.security.interfaces.DSAPublicKey;
import java.security.interfaces.ECPublicKey;
import java.security.interfaces.RSAPublicKey;
import java.util.Map;
@ -81,6 +80,7 @@ public class JwkKeyListView extends AbstractView {
return o;
} else if (src instanceof ECPublicKey) {
@SuppressWarnings("unused")
ECPublicKey ec = (ECPublicKey)src;
// TODO: serialize the EC

View File

@ -1,8 +1,6 @@
package org.mitre.openid.connect.web;
import java.security.PublicKey;
import java.security.interfaces.ECPublicKey;
import java.security.interfaces.RSAPublicKey;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

View File

@ -1,8 +1,5 @@
package org.mitre.openid.connect.web;
import org.mitre.jwt.model.Jwt;
import org.mitre.jwt.model.JwtClaims;
import org.mitre.jwt.model.JwtHeader;
import org.mitre.oauth2.model.ClientDetailsEntity;
import org.mitre.oauth2.model.OAuth2AccessTokenEntity;
import org.mitre.oauth2.service.OAuth2TokenEntityService;

View File

@ -1,13 +1,11 @@
package org.mitre.swd.view;
import java.io.Writer;
import java.lang.reflect.Type;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.web.servlet.view.AbstractView;
@ -15,10 +13,6 @@ import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
public class JsonOpenIdConfigurationView extends AbstractView {

View File

@ -4,13 +4,11 @@
package org.mitre.swd.view;
import java.io.Writer;
import java.lang.reflect.Type;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.web.servlet.view.AbstractView;
@ -18,10 +16,6 @@ import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
/**
* @author jricher

View File

@ -1,10 +1,10 @@
package org.mitre.util.jpa;
import org.springframework.dao.IncorrectResultSizeDataAccessException;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import javax.persistence.EntityManager;
import java.util.List;
import org.springframework.dao.IncorrectResultSizeDataAccessException;
/**
* @author mfranklin

View File

@ -25,7 +25,7 @@ $(function () {
+ '</div>'
, $topbar = $(topbarHTML).topbar()
ok(topbar.find('.active', true)
ok(topbar.find('.active', true))
})
})

@ -1 +1 @@
Subproject commit 2e7150fc0fd1307bc4adb33112bd9487e5b9715f
Subproject commit 5a784a9fb7ac11a46cc161e94676e62dac57c2c8