Package de.xima.fc.security.helper
Class SecurityProfileHelper
java.lang.Object
de.xima.fc.security.helper.SecurityProfileHelper
Helper for working with profiles.
- Since:
- 8.0.0
- Author:
- XIMA Media GmbH
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addPicture
(org.pac4j.core.profile.UserProfile pac4jProfile, UserProfile userProfile) static UserIdentity
connectAccountBasedOnEmail
(org.pac4j.core.profile.UserProfile profile) Connects the user authentication (identity) provided by the given pac4j profile to an existing formcycle user profile account that has the same verified email address as the one provided by the pac4j profile.static UserProfile
createUserProfile
(org.pac4j.core.profile.UserProfile pac4jProfile, Locale locale) static IClientDescriptor
getAuthenticationClient
(org.pac4j.core.profile.UserProfile profile) static Set<IClientAuthorization>
getClientAuthorizations
(org.pac4j.core.profile.UserProfile pac4jProfile) static EGender
getGender
(org.pac4j.core.profile.UserProfile profile) static UserIdentity
getNewUserIdentity
(org.pac4j.core.profile.UserProfile pac4jProfile) static UserProfile
getNewUserProfile
(org.pac4j.core.profile.UserProfile pac4jProfile) getPermissions
(org.pac4j.core.profile.UserProfile pac4jProfile) static byte[]
getPictureData
(org.pac4j.core.profile.UserProfile pac4jProfile) static URI
getPictureUri
(org.pac4j.core.profile.UserProfile pac4jProfile) static org.pac4j.core.profile.UserProfile
static org.pac4j.core.profile.UserProfile
getSystemUserProfile
(UserProfile userProfile) static org.pac4j.core.profile.UserProfile
getTestUserProfile
(DirectClientAuthorization authorization) Creates an anonymous user profile for testing purposes (used in the CLOUD).static String
getUniversalReferenceId
(org.pac4j.core.profile.UserProfile pac4jProfile) static Optional<org.pac4j.core.profile.UserProfile>
getUserProfile
(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, IAuthenticationTarget target) static UserProfile
getUserProfile
(org.pac4j.core.profile.UserProfile profile) static boolean
static boolean
isMultiFactorAuthenticated
(org.pac4j.core.profile.UserProfile pac4jProfile) static boolean
static UserProfile
readUserProfileByVerifiedEmail
(String emailAddress) static void
refreshProfile
(org.pac4j.core.profile.UserProfile pac4jProfile) static void
saveProfileInSession
(org.pac4j.core.profile.UserProfile profile, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, IAuthenticationTarget target) static boolean
shouldReIssueVerificationLink
(UserEmail userEmail)
-
Field Details
-
DEFAULT_LDAP_USER_ATTRIBUTES
-
-
Method Details
-
isMultiFactorAuthenticationNeeded
-
isMultiFactorAuthenticated
-
isMultiFactorAuthenticated
public static boolean isMultiFactorAuthenticated(org.pac4j.core.profile.UserProfile pac4jProfile) -
shouldReIssueVerificationLink
-
getUserProfile
public static Optional<org.pac4j.core.profile.UserProfile> getUserProfile(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, IAuthenticationTarget target) -
getSuperUserProfile
public static org.pac4j.core.profile.UserProfile getSuperUserProfile() -
getSystemUserProfile
-
getTestUserProfile
public static org.pac4j.core.profile.UserProfile getTestUserProfile(DirectClientAuthorization authorization) Creates an anonymous user profile for testing purposes (used in the CLOUD). Users with this profile can test functionality within the client provided by the authorization. The access to the client is only granted for the time of the HTTP session.- Parameters:
authorization
- to allow testing for.- Returns:
- the newly created profile for testing purposes.
-
getNewUserProfile
-
getNewUserIdentity
-
getAuthenticationClient
-
getGender
-
getPictureData
public static byte[] getPictureData(org.pac4j.core.profile.UserProfile pac4jProfile) -
getPictureUri
-
getUniversalReferenceId
-
getPermissions
-
getClientAuthorizations
public static Set<IClientAuthorization> getClientAuthorizations(org.pac4j.core.profile.UserProfile pac4jProfile) -
getUserProfile
-
readUserProfileByVerifiedEmail
-
createUserProfile
public static UserProfile createUserProfile(org.pac4j.core.profile.UserProfile pac4jProfile, Locale locale) -
refreshProfile
public static void refreshProfile(org.pac4j.core.profile.UserProfile pac4jProfile) -
saveProfileInSession
public static void saveProfileInSession(org.pac4j.core.profile.UserProfile profile, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, IAuthenticationTarget target) -
addPicture
public static void addPicture(org.pac4j.core.profile.UserProfile pac4jProfile, UserProfile userProfile) -
connectAccountBasedOnEmail
@Nullable public static UserIdentity connectAccountBasedOnEmail(org.pac4j.core.profile.UserProfile profile) Connects the user authentication (identity) provided by the given pac4j profile to an existing formcycle user profile account that has the same verified email address as the one provided by the pac4j profile.- Parameters:
profile
- to be connected to an existing formcycle user profile based on the email address.- Returns:
- the user identity that has been created if the account could be connected to an existing user profile and
null
otherwise.
-