Class SecurityUtil
java.lang.Object
com.evolveum.midpoint.security.api.SecurityUtil
- Author:
- Radovan Semancik
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic @NotNull Authorizationstatic Collection<String>getActions(Collection<org.springframework.security.access.ConfigAttribute> configAttributes) static org.springframework.security.core.Authenticationstatic intgetCredentialHistoryLength(CredentialPolicyType credentialPolicy) static @NotNull CredentialsStorageTypeTypegetCredentialStorageType(@Nullable CredentialPolicyType defaultPolicy, @Nullable CredentialPolicyType specificPolicy) static CredentialsStorageTypeTypegetCredentialStorageTypeType(CredentialsStorageMethodType storageMethod) static HttpConnectionInformationReturns current connection information, as derived from HTTP request stored in current thread.getEffectiveAttributeVerificationCredentialsPolicy(SecurityPolicyType securityPolicy) static List<NonceCredentialsPolicyType>getEffectiveNonceCredentialsPolicies(SecurityPolicyType securityPolicy) static NonceCredentialsPolicyTypegetEffectiveNonceCredentialsPolicy(SecurityPolicyType securityPolicy) getEffectivePasswordCredentialsPolicy(SecurityPolicyType securityPolicy) getEffectiveSecurityQuestionsCredentialsPolicy(SecurityPolicyType securityPolicy) static StringgetInvitationSequenceIdentifier(SecurityPolicyType securityPolicy) static ValuePolicyTypegetPasswordPolicy(SecurityPolicyType securityPolicy) Not very systematic.static @NotNull CredentialsStorageTypeTypegetPasswordStorageType(@Nullable CredentialsPolicyType credentialsPolicy) static MidPointPrincipalReturns principal representing currently logged-in user.static @Nullable MidPointPrincipalBenevolent version ofgetPrincipal()static Stringstatic MidPointPrincipalReturns the principal, insisting on that it exists.static MidPointPrincipalConsider using more benevolentgetPrincipalIfExists().static StringReturns short description of the subject suitable for log and error messages.static booleanisAuditedLoginAndLogout(SystemConfigurationType systemConfiguration, String channel) static booleanstatic booleanisHistoryAllowExistingPasswordReuse(CredentialPolicyType credentialPolicy) static booleanisOverFailedLockoutAttempts(int failedLogins, CredentialPolicyType credentialsPolicy) static booleanisRecordSessionLessAccessChannel(String channel) static booleanisRestAndActuatorChannel(String channel) static voidlogSecurityDeny(MidPointPrincipal midPointPrincipal, Object object, String message) static voidlogSecurityDeny(Object object, String message) static voidlogSecurityDeny(Object object, String message, Throwable cause, Collection<String> requiredAuthorizations) static void
- 
Constructor Details- 
SecurityUtilpublic SecurityUtil()
 
- 
- 
Method Details- 
getActionspublic static Collection<String> getActions(Collection<org.springframework.security.access.ConfigAttribute> configAttributes) 
- 
logSecurityDeny
- 
logSecurityDenypublic static void logSecurityDeny(MidPointPrincipal midPointPrincipal, Object object, String message) 
- 
logSecurityDenypublic static void logSecurityDeny(Object object, String message, Throwable cause, Collection<String> requiredAuthorizations) 
- 
getSubjectDescriptionReturns 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)
- 
getPasswordStorageType@NotNull public static @NotNull CredentialsStorageTypeType getPasswordStorageType(@Nullable @Nullable CredentialsPolicyType credentialsPolicy) 
- 
getCredentialStorageType@NotNull public static @NotNull CredentialsStorageTypeType getCredentialStorageType(@Nullable @Nullable CredentialPolicyType defaultPolicy, @Nullable @Nullable CredentialPolicyType specificPolicy) 
- 
getEffectivePasswordCredentialsPolicypublic static PasswordCredentialsPolicyType getEffectivePasswordCredentialsPolicy(SecurityPolicyType securityPolicy) 
- 
getInvitationSequenceIdentifier
- 
getEffectiveSecurityQuestionsCredentialsPolicypublic static SecurityQuestionsCredentialsPolicyType getEffectiveSecurityQuestionsCredentialsPolicy(SecurityPolicyType securityPolicy) 
- 
getEffectiveAttributeVerificationCredentialsPolicypublic static AttributeVerificationCredentialsPolicyType getEffectiveAttributeVerificationCredentialsPolicy(SecurityPolicyType securityPolicy) 
- 
getEffectiveNonceCredentialsPoliciespublic static List<NonceCredentialsPolicyType> getEffectiveNonceCredentialsPolicies(SecurityPolicyType securityPolicy) 
- 
getEffectiveNonceCredentialsPolicypublic static NonceCredentialsPolicyType getEffectiveNonceCredentialsPolicy(SecurityPolicyType securityPolicy) throws SchemaException - Throws:
- SchemaException
 
- 
getCredentialHistoryLength
- 
isHistoryAllowExistingPasswordReuse
- 
getCredentialStorageTypeTypepublic static CredentialsStorageTypeType getCredentialStorageTypeType(CredentialsStorageMethodType storageMethod) 
- 
getPasswordPolicyNot very systematic. Used mostly in hacks.
- 
setRemoteHostAddressHeaders
- 
getCurrentConnectionInformationReturns 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).
- 
getPrincipalSilentConsider using more benevolentgetPrincipalIfExists().
- 
getPrincipalReturns principal representing currently logged-in user. Returns null if the user is anonymous.- Throws:
- SecurityViolationException
 
- 
getPrincipalIfExistsBenevolent version ofgetPrincipal()
- 
getPrincipalRequiredReturns the principal, insisting on that it exists.- Throws:
- SecurityViolationException
 
- 
getPrincipalOidIfAuthenticated
- 
isAuthenticatedpublic static boolean isAuthenticated()
- 
getAuthenticationpublic static org.springframework.security.core.Authentication getAuthentication()
- 
isRecordSessionLessAccessChannel
- 
isRestAndActuatorChannel
- 
isAuditedLoginAndLogoutpublic static boolean isAuditedLoginAndLogout(SystemConfigurationType systemConfiguration, String channel) 
- 
isOverFailedLockoutAttemptspublic static boolean isOverFailedLockoutAttempts(int failedLogins, CredentialPolicyType credentialsPolicy) 
- 
createPrivilegedAuthorization
 
-