io.milton.sso.SsoAuthenticationHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of milton-server-ent Show documentation
Show all versions of milton-server-ent Show documentation
Milton Enterprise: Supports DAV level 2 and above, including Caldav and Carddav. Available on AGPL or
commercial licenses
/*
* Copyright 2012 McEvoy Software Ltd.
*
*
*/
package io.milton.sso;
import io.milton.http.AuthenticationHandler;
import io.milton.http.Request;
import io.milton.resource.Resource;
import java.util.List;
/**
* This is a post resource-resolution authentication handler.
*
* It assumes that the SsoResourceFactory has populated the _sso_user request
* attribute if appropriate
*
* @author brad
*/
public class SsoAuthenticationHandler implements AuthenticationHandler {
@Override
public boolean supports(Resource r, Request request) {
return request.getAttributes().get("_sso_user") != null;
}
@Override
public Object authenticate(Resource resource, Request request) {
return request.getAttributes().get("_sso_user");
}
@Override
public void appendChallenges(Resource resource, Request request, List challenges) {
}
@Override
public boolean isCompatible(Resource resource, Request request) {
return true;
}
@Override
public boolean credentialsPresent(Request request) {
return request.getParams() != null && request.getAttributes().containsKey("_sso_user");
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy