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

com.github.cobrijani.model.SimpleUserDetails Maven / Gradle / Ivy

package com.github.cobrijani.model;

import lombok.AllArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Arrays;
import java.util.Collection;

/**
 * Simple implementation of {@link UserDetails}
 * Created by SBratic on 2/18/2017.
 */
@AllArgsConstructor
public class SimpleUserDetails implements UserDetails {


  private String username;

  private char[] password;

  private Collection authorities;


  @Override
  public Collection getAuthorities() {
    return authorities;
  }

  @Override
  public String getPassword() {
    return Arrays.toString(password);
  }

  @Override
  public String getUsername() {
    return username;
  }

  @Override
  public boolean isAccountNonExpired() {
    return true;
  }

  @Override
  public boolean isAccountNonLocked() {
    return true;
  }

  @Override
  public boolean isCredentialsNonExpired() {
    return true;
  }

  @Override
  public boolean isEnabled() {
    return true;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy