Search in sources :

Example 6 with IdentityService

use of org.eclipse.jetty.security.IdentityService in project blade by biezhi.

the class DeferredAuthentication method authenticate.

/* ------------------------------------------------------------ */
/**
     * @see Deferred#authenticate(ServletRequest, ServletResponse)
     */
@Override
public Authentication authenticate(ServletRequest request, ServletResponse response) {
    try {
        LoginService login_service = _authenticator.getLoginService();
        IdentityService identity_service = login_service.getIdentityService();
        Authentication authentication = _authenticator.validateRequest(request, response, true);
        if (authentication instanceof User && identity_service != null)
            _previousAssociation = identity_service.associate(((User) authentication).getUserIdentity());
        return authentication;
    } catch (ServerAuthException e) {
        LOG.debug(e);
    }
    return this;
}
Also used : IdentityService(org.eclipse.jetty.security.IdentityService) UserAuthentication(org.eclipse.jetty.security.UserAuthentication) Authentication(org.eclipse.jetty.server.Authentication) ServerAuthException(org.eclipse.jetty.security.ServerAuthException) LoginService(org.eclipse.jetty.security.LoginService)

Aggregations

IdentityService (org.eclipse.jetty.security.IdentityService)6 UserAuthentication (org.eclipse.jetty.security.UserAuthentication)6 LoginService (org.eclipse.jetty.security.LoginService)4 ServerAuthException (org.eclipse.jetty.security.ServerAuthException)4 Authentication (org.eclipse.jetty.server.Authentication)4 UserIdentity (org.eclipse.jetty.server.UserIdentity)2