Examples of UserDetails


Examples of org.acegisecurity.userdetails.UserDetails

    public void set(Authentication a) throws IOException, InterruptedException {
        Jenkins h = Jenkins.getInstance();

        // make sure that this security realm is capable of retrieving the authentication by name,
        // as it's not required.
        UserDetails u = h.getSecurityRealm().loadUserByUsername(a.getName());
        props.setProperty(getPropertyKey(), Secret.fromString(u.getUsername()).getEncryptedValue());

        save();
    }
View Full Code Here

Examples of org.acegisecurity.userdetails.UserDetails

     *
     * @since 1.419
     */
    public Authentication impersonate() {
        try {
            UserDetails u = Jenkins.getInstance().getSecurityRealm().loadUserByUsername(id);
            return new UsernamePasswordAuthenticationToken(u.getUsername(), "", u.getAuthorities());
        } catch (AuthenticationException e) {
            // TODO: use the stored GrantedAuthorities
            return new UsernamePasswordAuthenticationToken(id, "",
                new GrantedAuthority[]{SecurityRealm.AUTHENTICATED_AUTHORITY});
        }
View Full Code Here

Examples of org.apache.oodt.security.sso.opensso.UserDetails

    if (cookieVal == null) {
      // let's try and get the SSO token
      // and pull the username from there
      String ssoToken = this.getSSOToken();
      if (ssoToken != null) {
        UserDetails details = null;
        try {
          details = this.ssoProxy.getUserAttributes(ssoToken);
        } catch (Exception e) {
          e.printStackTrace();
          return UNKNOWN_USER;
        }
        return details.getAttributes().getMetadata(UID_ATTRIBUTE_NAME) != null ? details
            .getAttributes().getMetadata(UID_ATTRIBUTE_NAME) : UNKNOWN_USER;
      } else
        return UNKNOWN_USER;
    } else {
      return new String(Base64.decodeBase64(cookieVal.getBytes()));
View Full Code Here

Examples of org.beangle.security.auth.ui.UserDetails

public class AuthorityListener extends AbstractAuthenticationListener {
  protected AuthorityManager authorityManager;

  public void afterAuthenticate(Authentication auth) {
    UserDetails details = (UserDetails) auth.getDetails();
    authorityManager.registerAuthorities(details.getUserid());
  }
View Full Code Here

Examples of org.beangle.security.monitor.auth.ui.UserDetails

public class AuthorityListener extends AbstractAuthenticationListener {
  protected AuthorityManager authorityManager;

  public void afterAuthenticate(Authentication auth) {
    UserDetails details = (UserDetails) auth.getDetails();
    authorityManager.registerAuthorities(details.getUserid());
  }
View Full Code Here

Examples of org.internna.ossmoney.model.security.UserDetails

        binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
    }

    @RequestMapping
    public String index(ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      modelMap.addAttribute("bills", Bill.findByOwner(user));
        return "bills/index";
    }
View Full Code Here

Examples of org.springframework.security.core.userdetails.UserDetails

        expect(userService.getUserByUsername(username)).andReturn(user).once();
        expectLastCall();

        replay(userService, ctx);

        final UserDetails userDetails =
                contextMapper.mapUserFromContext(ctx, username, Collections.<GrantedAuthority>emptyList());

        verify(userService, ctx);
        assertEquals(user, userDetails);
    }
View Full Code Here

Examples of org.springframework.security.core.userdetails.UserDetails

        expect(userService.getUserByUsername(username)).andReturn(user).once();
        expectLastCall();

        replay(userService, ctx);

        final UserDetails userDetails =
                contextMapper.mapUserFromContext(ctx, username, Collections.<GrantedAuthority>emptyList());

        verify(userService, ctx);
        assertEquals(user, userDetails);
    }
View Full Code Here

Examples of org.springframework.security.core.userdetails.UserDetails

        expect(userService.getUserByUsername(username)).andReturn(user);
        expectLastCall();

        replay(userService);

        final UserDetails userDetails =
                contextMapper.mapUserFromContext(ctx, username, Collections.<GrantedAuthority>emptyList());

        verify(userService);
        assertEquals(user, userDetails);
    }
View Full Code Here

Examples of org.springframework.security.core.userdetails.UserDetails

        List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
        for (Entitlement entitlement : entitlementDAO.findAll()) {
            authorities.add(new SimpleGrantedAuthority(entitlement.getName()));
        }

        UserDetails userDetails = new User(adminUser, "FAKE_PASSWORD", true, true, true, true, authorities);
        Authentication authentication = new TestingAuthenticationToken(userDetails, "FAKE_PASSWORD", authorities);
        SecurityContextHolder.getContext().setAuthentication(authentication);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.