Class SecurityUtil
- java.lang.Object
-
- com.evolveum.midpoint.security.api.SecurityUtil
-
public class SecurityUtil extends Object
- Author:
- Radovan Semancik
-
-
Constructor Summary
Constructors Constructor Description SecurityUtil()
-
Method Summary
-
-
-
Method Detail
-
getActions
public static Collection<String> getActions(Collection<org.springframework.security.access.ConfigAttribute> configAttributes)
-
logSecurityDeny
public static void logSecurityDeny(MidPointPrincipal midPointPrincipal, Object object, String message)
-
logSecurityDeny
public static void logSecurityDeny(Object object, String message, Throwable cause, Collection<String> requiredAuthorizations)
-
getSubjectDescription
public static String getSubjectDescription()
Returns short description of the subject suitable for log and error messages. Does not throw errors. Safe to toString-like methods. May return null (means anonymous or unknown)
-
getCredentialPolicyItem
public static <T> T getCredentialPolicyItem(CredentialPolicyType defaultPolicy, CredentialPolicyType policy, Function<CredentialPolicyType,T> getter)
-
getEffectivePasswordCredentialsPolicy
public static PasswordCredentialsPolicyType getEffectivePasswordCredentialsPolicy(SecurityPolicyType securityPolicy)
-
getEffectiveSecurityQuestionsCredentialsPolicy
public static SecurityQuestionsCredentialsPolicyType getEffectiveSecurityQuestionsCredentialsPolicy(SecurityPolicyType securityPolicy)
-
getEffectiveNonceCredentialsPolicies
public static List<NonceCredentialsPolicyType> getEffectiveNonceCredentialsPolicies(SecurityPolicyType securityPolicy)
-
getEffectiveNonceCredentialsPolicy
public static NonceCredentialsPolicyType getEffectiveNonceCredentialsPolicy(SecurityPolicyType securityPolicy) throws SchemaException
- Throws:
SchemaException
-
getCredentialHistoryLength
public static int getCredentialHistoryLength(CredentialPolicyType credentialPolicy)
-
isHistoryAllowExistingPasswordReuse
public static boolean isHistoryAllowExistingPasswordReuse(CredentialPolicyType credentialPolicy)
-
getCredentialStorageTypeType
public static CredentialsStorageTypeType getCredentialStorageTypeType(CredentialsStorageMethodType storageMethod)
-
getPasswordPolicy
public static ValuePolicyType getPasswordPolicy(SecurityPolicyType securityPolicy)
Not very systematic. Used mostly in hacks.
-
setRemoteHostAddressHeaders
public static void setRemoteHostAddressHeaders(SystemConfigurationType config)
-
getCurrentConnectionInformation
public static HttpConnectionInformation getCurrentConnectionInformation()
Returns current connection information, as derived from HTTP request stored in current thread. May be null if the thread is not associated with any HTTP request (e.g. task threads, operations invoked from GUI but executing in background).
-
getPrincipal
public static MidPointPrincipal getPrincipal() throws SecurityViolationException
Returns principal representing currently logged-in user. Returns null if the user is anonymous.- Throws:
SecurityViolationException
-
getPrincipalOidIfAuthenticated
public static String getPrincipalOidIfAuthenticated()
-
isAuthenticated
public static boolean isAuthenticated()
-
getAuthentication
public static org.springframework.security.core.Authentication getAuthentication()
-
isRecordSessionLessAccessChannel
public static boolean isRecordSessionLessAccessChannel(String channel)
-
isAuditedLoginAndLogout
public static boolean isAuditedLoginAndLogout(SystemConfigurationType systemConfiguration, String channel)
-
-