Class UserFactory


  • public class UserFactory
    extends Object
    Factory for creating IUsers.
    Since:
    8.0.0
    Author:
    XIMA Media GmbH
    • Method Detail

      • registerUserProducer

        public static void registerUserProducer​(Function<org.pac4j.core.profile.UserProfile,​IUser> userProducer)
      • registerConfigProducer

        public static void registerConfigProducer​(Function<? super IAuthenticationTarget,​? extends org.pac4j.core.config.Config> configProducer)
        Registers producer for a Pac4J Config. The producer is given the IAuthenticationTarget. It may return null when it cannot produce a config for the given authentication target. The config of the first producer that returns a non-null value will be used. When no producer returns a config, no config i
        Parameters:
        configProducer - producer for a Pac4J Config.
      • forWebContext

        public static IUser forWebContext​(javax.servlet.http.HttpServletRequest req,
                                          javax.servlet.http.HttpServletResponse resp,
                                          IAuthenticationTarget target)
      • forPac4jProfile

        public static IUser forPac4jProfile​(org.pac4j.core.profile.UserProfile pac4jProfile)
      • userForPac4jProfile

        public static IUser userForPac4jProfile​(org.pac4j.core.profile.UserProfile pac4jProfile)