Class OpenIdLoginService

    • Constructor Detail

      • OpenIdLoginService

        public OpenIdLoginService​(OpenIdConfiguration configuration,
                                  LoginService loginService)
        Use a wrapped LoginService to store information about user roles. Users in the wrapped loginService must be stored with their username as the value of the sub (subject) Claim, and a credentials value of the empty string.
        Parameters:
        configuration - the OpenID configuration to use.
        loginService - the wrapped LoginService to defer to for user roles.
    • Method Detail

      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface LoginService
        Returns:
        Get the name of the login service (aka Realm name)
      • login

        public UserIdentity login​(java.lang.String identifier,
                                  java.lang.Object credentials,
                                  javax.servlet.ServletRequest req)
        Description copied from interface: LoginService
        Login a user.
        Specified by:
        login in interface LoginService
        Parameters:
        identifier - The user name
        credentials - The users credentials
        req - TODO
        Returns:
        A UserIdentity if the credentials matched, otherwise null
      • isAuthenticateNewUsers

        public boolean isAuthenticateNewUsers()
      • setAuthenticateNewUsers

        public void setAuthenticateNewUsers​(boolean authenticateNewUsers)
        This setting is only meaningful if a wrapped LoginService has been set.

        If set to true, any users not found by the wrapped LoginService will still be authenticated but with no roles, if set to false users will not be authenticated unless they are discovered by the wrapped LoginService.

        Parameters:
        authenticateNewUsers - whether to authenticate users not found by a wrapping LoginService
      • getIdentityService

        public IdentityService getIdentityService()
        Description copied from interface: LoginService
        Get the IdentityService associated with this Login Service.
        Specified by:
        getIdentityService in interface LoginService
        Returns:
        the IdentityService associated with this Login Service.
      • setIdentityService

        public void setIdentityService​(IdentityService service)
        Description copied from interface: LoginService
        Set the IdentityService associated with this Login Service.
        Specified by:
        setIdentityService in interface LoginService
        Parameters:
        service - the IdentityService associated with this Login Service.