View Javadoc
1   package org.springframework.security.oauth.provider;
2   
3   import org.springframework.security.core.Authentication;
4   import org.springframework.security.oauth.provider.token.OAuthAccessProviderToken;
5   
6   import javax.servlet.http.HttpServletRequest;
7   
8   /**
9    * Callback interface for handing authentication details that are used when an authenticated request for a protected resource is received.
10   *
11   * @author Ryan Heaton
12   */
13  public interface OAuthAuthenticationHandler {
14  
15    /**
16     * Create the authentication object for an authenticated OAuth request.
17     *
18     * @param request The request that was successfully authenticated.
19     * @param authentication The consumer authentication (details about how the request was authenticated).
20     * @param authToken The OAuth token associated with the authentication. This token MAY be null if no authenticated token was needed to successfully
21     * authenticate the request (for example, in the case of 2-legged OAuth).
22     * @return The new authentication object. For example, the user authentication if the request is made on behalf of a user.
23     */
24    Authentication createAuthentication(HttpServletRequest request, ConsumerAuthentication authentication, OAuthAccessProviderToken authToken);
25  }