
com.daedafusion.security.identity.providers.impl.SingleAPInspector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of security-framework Show documentation
Show all versions of security-framework Show documentation
A pluggable security framework "inspired" by the OWASP ESAPI framework
The newest version!
package com.daedafusion.security.identity.providers.impl;
import com.daedafusion.sf.AbstractProvider;
import com.daedafusion.security.authentication.Subject;
import com.daedafusion.security.identity.providers.SubjectInspectorProvider;
import org.apache.log4j.Logger;
/**
* Assumes there is one AP in a subject. If there happens to be multiple, it returns the first.
*/
public class SingleAPInspector extends AbstractProvider implements SubjectInspectorProvider
{
private static final Logger log = Logger.getLogger(SingleAPInspector.class);
@Override
public String getFullyQualifiedUsername(Subject subject)
{
return subject.getPrincipals().iterator().next().getDomainQualifiedName();
}
@Override
public String getDomain(Subject subject)
{
return subject.getPrincipals().iterator().next().getDomain();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy