@SessionAttributes(value={"authorizationRequest","org.springframework.security.oauth2.provider.endpoint.AuthorizationEndpoint.ORIGINAL_AUTHORIZATION_REQUEST"}) public class AuthorizationEndpoint extends AbstractEndpoint
Implementation of the Authorization Endpoint from the OAuth2 specification. Accepts authorization requests, and
handles user approval if the grant type is authorization code. The tokens themselves are obtained from the
Token Endpoint
, except in the implicit grant type (where they come from the Authorization
Endpoint via response_type=token
.
This endpoint should be secured so that it is only accessible to fully authenticated users (as a minimum requirement) since it represents a request from a valid user to act on his or her behalf.
logger
Constructor and Description |
---|
AuthorizationEndpoint() |
afterPropertiesSet, getClientDetailsService, getDefaultOAuth2RequestFactory, getExceptionTranslator, getOAuth2RequestFactory, getTokenGranter, setClientDetailsService, setOAuth2RequestFactory, setProviderExceptionHandler, setTokenGranter
public void setSessionAttributeStore(SessionAttributeStore sessionAttributeStore)
public void setErrorPage(String errorPage)
@RequestMapping(value="/oauth/authorize") public ModelAndView authorize(Map<String,Object> model, @RequestParam Map<String,String> parameters, SessionStatus sessionStatus, Principal principal)
@RequestMapping(value="/oauth/authorize", method=POST, params="user_oauth_approval") public View approveOrDeny(@RequestParam Map<String,String> approvalParameters, Map<String,?> model, SessionStatus sessionStatus, Principal principal)
public void setUserApprovalPage(String userApprovalPage)
public void setAuthorizationCodeServices(AuthorizationCodeServices authorizationCodeServices)
public void setRedirectResolver(RedirectResolver redirectResolver)
public void setUserApprovalHandler(UserApprovalHandler userApprovalHandler)
public void setOAuth2RequestValidator(OAuth2RequestValidator oauth2RequestValidator)
public void setImplicitGrantService(ImplicitGrantService implicitGrantService)
@ExceptionHandler(value=ClientRegistrationException.class) public ModelAndView handleClientRegistrationException(Exception e, ServletWebRequest webRequest) throws Exception
Exception
@ExceptionHandler(value=OAuth2Exception.class) public ModelAndView handleOAuth2Exception(OAuth2Exception e, ServletWebRequest webRequest) throws Exception
Exception
@ExceptionHandler(value=org.springframework.web.HttpSessionRequiredException.class) public ModelAndView handleHttpSessionRequiredException(HttpSessionRequiredException e, ServletWebRequest webRequest) throws Exception
Exception
Copyright © 2019. All rights reserved.