All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.duracloud.security.impl.DuracloudUserDetails Maven / Gradle / Ivy

There is a newer version: 8.1.0
Show newest version
/*
 * The contents of this file are subject to the license and copyright
 * detailed in the LICENSE and NOTICE files at the root of the source
 * tree and available online at
 *
 *     http://duracloud.org/license/
 */
package org.duracloud.security.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * @author Andrew Woods
 * Date: 11/11/11
 */
public class DuracloudUserDetails extends User implements UserDetails {

    private String email;
    private String ipLimits;
    private List groups;

    public DuracloudUserDetails(String username,
                                String password,
                                String email,
                                String ipLimits,
                                boolean enabled,
                                boolean accountNonExpired,
                                boolean credentialsNonExpired,
                                boolean accountNonLocked,
                                Collection authorities,
                                List groups)
        throws IllegalArgumentException {
        super(username,
              password,
              enabled,
              accountNonExpired,
              credentialsNonExpired,
              accountNonLocked,
              authorities);
        this.email = email;
        this.ipLimits = ipLimits;
        this.groups = groups;
    }

    public String getEmail() {
        return email;
    }

    public String getIpLimits() {
        return ipLimits;
    }

    @Override
    public void eraseCredentials() {
        //The credentials are getting erased despite my using the
        //erase-credentials="false" in security-config.xml
        //overriding prevents the erasure from occurring.
        //--db
        //prevent password from being erased.
    }

    public List getGroups() {
        return groups;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy