Package org.springframework.security.userdetails

Examples of org.springframework.security.userdetails.UserDetails


    if ( usernameAttributeValue == null ) {
      throw new IllegalStateException( Messages.getInstance().getErrorString(
          "UseridAttributeLdapContextMapper.ERROR_0001_ATTRIBUTE_NOT_FOUND", getLdapUsernameAttribute() ) );
    }
    // Pass along the attribute value, not the typed in value
    UserDetails rtn = super.mapUserFromContext( ctx, usernameAttributeValue, authorities );
    return rtn;
  }
View Full Code Here


  public UserDetails loadUserByUsername( final String username ) throws UsernameNotFoundException, DataAccessException {
    if ( logger.isDebugEnabled() ) {
      logger.debug( "injecting proxy" ); //$NON-NLS-1$
    }
    UserDetails userDetails = userDetailsService.loadUserByUsername( username );

    return getUserDetailsWithDefaultRole( userDetails );
  }
View Full Code Here

    StandaloneSession pentahoSession = new StandaloneSession( repositoryAdminUsername );
    pentahoSession.setAuthenticated( repositoryAdminUsername );
    final GrantedAuthority[] repositoryAdminAuthorities =
        new GrantedAuthority[]{new GrantedAuthorityImpl( sysAdminRoleName )};
    final String password = "ignored";
    UserDetails repositoryAdminUserDetails =
        new User( repositoryAdminUsername, password, true, true, true, true, repositoryAdminAuthorities );
    Authentication repositoryAdminAuthentication =
        new UsernamePasswordAuthenticationToken( repositoryAdminUserDetails, password, repositoryAdminAuthorities );
    PentahoSessionHolder.setSession( pentahoSession );
    // this line necessary for Spring Security's MethodSecurityInterceptor
View Full Code Here

    for ( String roleName : roles ) {
      authList.add( new GrantedAuthorityImpl( roleName ) );
    }
    GrantedAuthority[] authorities = authList.toArray( new GrantedAuthority[0] );
    UserDetails userDetails = new User( username, password, true, true, true, true, authorities );
    Authentication auth = new UsernamePasswordAuthenticationToken( userDetails, password, authorities );
    PentahoSessionHolder.setSession( pentahoSession );
    // this line necessary for Spring Security's MethodSecurityInterceptor
    SecurityContextHolder.getContext().setAuthentication( auth );
  }
View Full Code Here

    for ( String roleName : roles ) {
      authList.add( new GrantedAuthorityImpl( roleName ) );
    }
    GrantedAuthority[] authorities = authList.toArray( new GrantedAuthority[0] );
    UserDetails userDetails = new User( username, password, true, true, true, true, authorities );
    Authentication auth = new UsernamePasswordAuthenticationToken( userDetails, password, authorities );
    PentahoSessionHolder.setSession( pentahoSession );
    // this line necessary for Spring Security's MethodSecurityInterceptor
    SecurityContextHolder.getContext().setAuthentication( auth );
View Full Code Here

    StandaloneSession pentahoSession = new StandaloneSession( repositoryAdminUsername );
    pentahoSession.setAuthenticated( repositoryAdminUsername );
    final GrantedAuthority[] repositoryAdminAuthorities =
        new GrantedAuthority[] { new GrantedAuthorityImpl( superAdminRoleName ) };
    final String password = "ignored";
    UserDetails repositoryAdminUserDetails =
        new User( repositoryAdminUsername, password, true, true, true, true, repositoryAdminAuthorities );
    Authentication repositoryAdminAuthentication =
        new UsernamePasswordAuthenticationToken( repositoryAdminUserDetails, password, repositoryAdminAuthorities );
    PentahoSessionHolder.setSession( pentahoSession );
    // this line necessary for Spring Security's MethodSecurityInterceptor
View Full Code Here

            if (!(oPrincipal instanceof UserDetails)) {
                log.warn("Unsupported Principal type in Authentication. Skipping auto-registration.");
                return null;
            }
       
            UserDetails userDetails = (UserDetails) oPrincipal;
       
            userName = userDetails.getUsername();
            password = userDetails.getPassword();
            enabled = userDetails.isEnabled();
       
       
            if(userDetails instanceof RollerUserDetails) {
                RollerUserDetails rollerDetails = (RollerUserDetails) userDetails;
View Full Code Here

                } else {
                     authorities =  getAuthorities(userData, umgr);
                     name = userData.getUserName();
                     password = userData.getPassword();
                }
                UserDetails usr = new org.springframework.security.userdetails.User(name, password, true, authorities);
                return  usr;
               
            } else {
                try {
                    userData = umgr.getUserByUserName(userName);
View Full Code Here

      UserAttribute attr = (UserAttribute) configAttribEd.getValue();

      // Make a user object, assuming the properties were properly
      // provided
      if ( attr != null ) {
        UserDetails user =
            new User( username, attr.getPassword(), attr.isEnabled(), true, true, true, attr.getAuthorities() );
        userMap.addUser( user );
      }
    }
View Full Code Here

      return new GrantedAuthorityImpl( ( ( null != rolePrefix ) ? rolePrefix : "" ) + rs.getString( 1 ) ); //$NON-NLS-1$
    }
  }

  public List<String> getRolesForUser( final String username ) throws UsernameNotFoundException, DataAccessException {
    UserDetails user = userDetailsService.loadUserByUsername( username );
    List<String> roles = new ArrayList<String>( user.getAuthorities().length );
    for ( GrantedAuthority role : user.getAuthorities() ) {
      if ( roleMapper != null ) {
        roles.add( roleMapper.toPentahoRole( role.getAuthority() ) );
      } else {
        roles.add( role.getAuthority() );
      }
View Full Code Here

TOP

Related Classes of org.springframework.security.userdetails.UserDetails

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.