Interface OAuth2Resource

  • All Superinterfaces:
    Resource

    public interface OAuth2Resource
    extends Resource
    • Method Detail

      • authenticate

        Object authenticate​(OAuth2Resource.OAuth2ProfileDetails profile)
        Called when an oauth2 login response has been received, with details received from the remote server. The method should return an application specific object representing the user if one exists OR if the application chooses to create one. Or return null to indicate that this resource cannot authenticate the request. In that case the AuthenticationService may continue looking for other authentication providers which are able to authenticate the request. A typical workflow is that an OAuth response will be received, the current user will be authenticated from the CookieAuthenticationHandler, and the application will then choose to link the oauth credentials to the current user. Subsequently the user is then able to authenticat with oauth.
        Parameters:
        profile - - the details about the current user as provided by the remote authentication server
        Returns:
        an object which represents the current principal, or null to reject the login