Package org.eclipse.jetty.util.security

Examples of org.eclipse.jetty.util.security.Credential


      for (final Role role : actor.getRoles()) {
        roles[++i] = role.getRole();
      }
      // The password should already be an MD5 hash using the same salt pattern as the
      // JPA provider
      final Credential cred = Credential.getCredential(MD5.__TYPE + actor.getPassword());
      return putUser(username, cred, roles);
    } catch (final Throwable t) {
      final String msg = String.format("Unable to authenticate %1$s",
          username);
      if (log.isDebugEnabled()) {
View Full Code Here


        final UserIdentity identity;
        if (info instanceof UserIdentity)
            identity=(UserIdentity)info;
        else
        {
            Credential credential = (info instanceof Credential)?(Credential)info:Credential.getCredential(info.toString());

            Principal userPrincipal = new KnownUser(userName,credential);
            Subject subject = new Subject();
            subject.getPrincipals().add(userPrincipal);
            subject.getPrivateCredentials().add(credential);
View Full Code Here

                if (roles != null && roles.length() > 0)
                {
                    roleArray = roles.split(",");
                }
                known.add(username);
                Credential credential = Credential.getCredential(credentials);

                Principal userPrincipal = new KnownUser(username,credential);
                Subject subject = new Subject();
                subject.getPrincipals().add(userPrincipal);
                subject.getPrivateCredentials().add(credential);
View Full Code Here

        for ( Principal principal : principals )
        {
            roles.add( principal.getName() );
        }

        Credential credential = (Credential)userIdentity.getSubject().getPrivateCredentials().iterator().next();
        LOG.debug("Found: " + userName + " in PropertyUserStore "+_filename);
        return new UserInfo(userName, credential, roles);
    }
View Full Code Here

        {
            return null;
        }

        pwdCredential = convertCredentialLdapToJetty(pwdCredential);
        Credential credential = Credential.getCredential(pwdCredential);
        List<String> roles = getUserRoles(_rootContext, username);

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

      securityHandler.addBean(loginService);
        return securityHandler;
    }

    private HashLoginService getLoginService(String pUser, String pPassword, String pRole) {
      Credential credential = Credential.getCredential(pPassword);
      HashLoginService loginService = new HashLoginService("jolokia Realm");
      loginService.putUser(pUser, credential, new String[] {pRole});
      return loginService;
    }
View Full Code Here

                if (roles != null && roles.length() > 0)
                {
                    roleArray = roles.split(",");
                }
                known.add(username);
                Credential credential = Credential.getCredential(credentials);
               
                Principal userPrincipal = new KnownUser(username,credential);
                Subject subject = new Subject();
                subject.getPrincipals().add(userPrincipal);
                subject.getPrivateCredentials().add(credential);
View Full Code Here

        final UserIdentity identity;
        if (info instanceof UserIdentity)
            identity=(UserIdentity)info;
        else
        {
            Credential credential = (info instanceof Credential)?(Credential)info:Credential.getCredential(info.toString());
           
            Principal userPrincipal = new KnownUser(userName,credential);
            Subject subject = new Subject();
            subject.getPrincipals().add(userPrincipal);
            subject.getPrivateCredentials().add(credential);
View Full Code Here

    @Override
    protected UserIdentity loadUser(String username) {
      Map<String,String> users = configuration.getUsers();

      if (users.containsKey(username)) {
        Credential credential = Credential.getCredential(users.get(username));

        Principal userPrincipal = new KnownUser(username, credential);

        Subject subject = new Subject();
        subject.getPrincipals().add(userPrincipal);
View Full Code Here

            GetResponse response = client.prepareGet(authIndex, authType, user)
                    .setFields(passwordField, rolesField)
                    .execute().actionGet();
            if (response.isExists()) {
                Log.debug("user [{}] exists; looking for credentials...", user);
                Credential credential = null;
                GetField passwordGetField = response.getField(passwordField);
                if (passwordGetField != null) {
                    Log.debug("user [{}] using password auth", user);
                    credential = Credential.getCredential((String) passwordGetField.getValue());
                }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.util.security.Credential

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.