I'm building OAuth2 authorization server using 1.0.1.RELEASE.
My authorization server is configured like this:
When hitting '/oauth/authorize', I get following error:Code:<oauth:authorization-server client-details-service-ref="clientDetailsService" token-services-ref="tokenServices"> <oauth:authorization-code/> </oauth:authorization-server>
I tracked the source of the issue to AuthorizationEndpoint.authorize method:Code:2013-02-28 13:24:41.209:WARN::/oauth/authorize org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Field or property 'authorizationRequest' cannot be found on object of type 'java.util.HashMap' at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:208) at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:72) at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:52) at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93) at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:88) at org.springframework.security.oauth2.provider.endpoint.WhitelabelApprovalEndpoint$SpelView$1.resolvePlaceholder(WhitelabelApprovalEndpoint.java:64) at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:146) at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:125) at org.springframework.security.oauth2.provider.endpoint.WhitelabelApprovalEndpoint$SpelView.render(WhitelabelApprovalEndpoint.java:79) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1157) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:927) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
After populating the model with 'authorizationRequest' parameter, the action redirects toCode:model.put("authorizationRequest", outgoingRequest);The execution is passed to WhitelabelApprovalEndpoint.getAccessConfirmation method:Code:forward:/oauth/confirm_access
From what I can see, the model here is expected to be containing 'authorizationRequest' parameter that was populated by AuthorizationEndpoint earlier. However, the model is empty, which eventually causes the exception above. When stopping on a breakpoint in this method, I can query 'authorizationRequest' parameter like this:Code:@RequestMapping("/oauth/confirm_access") public ModelAndView getAccessConfirmation(Map<String, Object> model) throws Exception { return new ModelAndView(new SpelView(APPROVAL), model); }
From my understanding of Spring MVC, after forwarding from request A to request B a model populated in request A will not be passed to request B explicitly, but its attributes will be available via HttpServletRequest attributes. If so, getAccessConfirmation method may have a bug. Or (more likely) I'm just doing something wrong. If so, please suggest.Code:RequestContextHolder.currentRequestAttributes().getAttribute("authorizationRequest",0)


Reply With Quote
