Class AuthenticatedNode

java.lang.Object
net.solarnetwork.central.security.AuthenticatedNode
All Implemented Interfaces:
Serializable, SecurityActor, SecurityNode, org.springframework.security.core.userdetails.UserDetails

public class AuthenticatedNode extends Object implements org.springframework.security.core.userdetails.UserDetails, SecurityNode
Implementation of Spring Security's UserDetails object for authenticated nodes.
See Also:
  • Constructor Details

    • AuthenticatedNode

      public AuthenticatedNode(Long nodeId, Collection<org.springframework.security.core.GrantedAuthority> auths, boolean authenticatedWithToken)
      Construct from and a node ID.
      Parameters:
      nodeId - the node ID
      auths - the granted authorities
      authenticatedWithToken - the authenticated with token flag
    • AuthenticatedNode

      public AuthenticatedNode(Long nodeId, String username, String password, Collection<org.springframework.security.core.GrantedAuthority> auths, boolean authenticatedWithToken)
      Construct from a node ID, username, and password.
      Parameters:
      nodeId - the node ID
      username - the username, e.g. auth token
      password - the password, e.g. auth secret
      auths - the granted authorities
      authenticatedWithToken - the authenticated with token flag
  • Method Details

    • getNodeId

      public Long getNodeId()
      Description copied from interface: SecurityNode
      Get the node's ID.
      Specified by:
      getNodeId in interface SecurityNode
      Returns:
      the nodeId
    • getAuthorities

      public Collection<org.springframework.security.core.GrantedAuthority> getAuthorities()
      Specified by:
      getAuthorities in interface org.springframework.security.core.userdetails.UserDetails
    • getPassword

      public String getPassword()
      Specified by:
      getPassword in interface org.springframework.security.core.userdetails.UserDetails
    • getUsername

      public String getUsername()
      Specified by:
      getUsername in interface org.springframework.security.core.userdetails.UserDetails
    • isAccountNonExpired

      public boolean isAccountNonExpired()
      Specified by:
      isAccountNonExpired in interface org.springframework.security.core.userdetails.UserDetails
    • isAccountNonLocked

      public boolean isAccountNonLocked()
      Specified by:
      isAccountNonLocked in interface org.springframework.security.core.userdetails.UserDetails
    • isCredentialsNonExpired

      public boolean isCredentialsNonExpired()
      Specified by:
      isCredentialsNonExpired in interface org.springframework.security.core.userdetails.UserDetails
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface org.springframework.security.core.userdetails.UserDetails
    • isAuthenticatedWithToken

      public boolean isAuthenticatedWithToken()
      Description copied from interface: SecurityActor
      Return true if the actor authenticated via a token.
      Specified by:
      isAuthenticatedWithToken in interface SecurityActor
      Returns:
      boolean