Package org.eclipse.jetty.plus.jaas.spi

Examples of org.eclipse.jetty.plus.jaas.spi.UserInfo


        pwdCredential = convertCredentialLdapToJetty(pwdCredential);

        Credential credential = Credential.getCredential(pwdCredential);
        List roles = getUserRoles(_rootContext, username);

        return new UserInfo(username, credential, roles);
    }
View Full Code Here


            if (_forceBindingLogin) {
                return bindingLogin(webUserName, webCredential);
            }

            // This sets read and the credential
            UserInfo userInfo = getUserInfo(webUserName);

            if (userInfo == null) {
                setAuthenticated(false);
                return false;
            }
View Full Code Here

            dirContext = _rootContext;
            LOG.debug("Using _rootContext for role lookup.");
        }
        List roles = getUserRolesByDn(dirContext, userDn, username);

        UserInfo userInfo = new UserInfo(username, null, roles);
        if (_cacheDuration > 0) {
            USERINFOCACHE.put(cacheToken,
                new CachedUserInfo(userInfo,
                    System.currentTimeMillis() + _cacheDuration));
            LOG.debug("Adding " + username + " set to expire: " + System.currentTimeMillis() + _cacheDuration);
View Full Code Here

     */
    public UserInfo getUserInfo(String username) throws Exception {
        DirContext dir = context();
        ArrayList roleList = new ArrayList(getUserRoles(username));
        String credentials = getUserCredentials(username);
        return new UserInfo(username, Credential.getCredential(credentials), roleList);

    }
View Full Code Here

                if ((webUserName == null) || (webCredential == null)) {
                    setAuthenticated(false);
                    return isAuthenticated();
                }
                ArrayList roleList = new ArrayList(getUserRoles(webUserName));
                UserInfo userInfo= new UserInfo(webUserName, null, roleList);

                log.debug("userRoles: " + roleList);
                if (userInfo == null) {
                    setAuthenticated(false);
                    return isAuthenticated();
View Full Code Here

    @Test
    public void testShouldGetNestedGroups() {
        JettyCachingLdapLoginModule module = getJettyCachingLdapLoginModule();
        module._nestedGroups = true;
        try {
            UserInfo userInfo = module.getUserInfo(user1);
            assertThat(userInfo.getUserName(), is(user1));

            List<String> actualRoles = userInfo.getRoleNames();
            List<String> expectedRoles = Arrays.asList(role1, role2, nestedRole1);
            assertThat(actualRoles, is(expectedRoles));
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

    @Test
    public void testShouldNotGetNestedGroups() {
        JettyCachingLdapLoginModule module = getJettyCachingLdapLoginModule();

        try {
            UserInfo userInfo = module.getUserInfo(user1);
            assertThat(userInfo.getUserName(), is(user1));

            List<String> actualRoles = userInfo.getRoleNames();
            List<String> expectedRoles = Arrays.asList(role1, role2);
            assertThat(actualRoles, is(expectedRoles));
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

*/
public class PermissiveLoginModule extends AbstractLoginModule {

  @Override
  public UserInfo getUserInfo(String username) throws Exception {
    return new UserInfo(username, new OpenGammaCredential(), ImmutableList.of("user"));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.plus.jaas.spi.UserInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.