reverted to original controller behavior

pull/263/head
Justin Richer 2012-11-26 11:11:47 -05:00
parent cf4581a5eb
commit 3e327b9df6
1 changed files with 5 additions and 4 deletions

View File

@ -23,10 +23,10 @@ import java.util.Map;
import org.mitre.oauth2.exception.ClientNotFoundException; import org.mitre.oauth2.exception.ClientNotFoundException;
import org.mitre.oauth2.service.ClientDetailsEntityService; import org.mitre.oauth2.service.ClientDetailsEntityService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.oauth2.provider.AuthorizationRequest; import org.springframework.security.oauth2.provider.AuthorizationRequest;
import org.springframework.security.oauth2.provider.ClientDetails; import org.springframework.security.oauth2.provider.ClientDetails;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes; import org.springframework.web.bind.annotation.SessionAttributes;
@ -51,11 +51,12 @@ public class OAuthConfirmationController {
this.clientService = clientService; this.clientService = clientService;
} }
//@PreAuthorize("hasRole('ROLE_USER')") @PreAuthorize("hasRole('ROLE_USER')")
@RequestMapping("/oauth/confirm_access") @RequestMapping("/oauth/confirm_access")
public ModelAndView confimAccess(Map<String, Object> model) { public ModelAndView confimAccess(Map<String, Object> model, @ModelAttribute("authorizationRequest") AuthorizationRequest clientAuth) {
//AuthorizationRequest clientAuth = (AuthorizationRequest) model.remove("authorizationRequest");
AuthorizationRequest clientAuth = (AuthorizationRequest) model.remove("authorizationRequest");
ClientDetails client = clientService.loadClientByClientId(clientAuth.getClientId()); ClientDetails client = clientService.loadClientByClientId(clientAuth.getClientId());