Class JwtAuthentication

java.lang.Object
ru.averkiev.socialmediaapi.security.JwtAuthentication
All Implemented Interfaces:
Serializable, Principal, org.springframework.security.core.Authentication

public class JwtAuthentication extends Object implements org.springframework.security.core.Authentication
Класс реализует функциональность связанную с аутентификацией.
Author:
mrGreenNV
See Also:
  • Constructor Details

    • JwtAuthentication

      public JwtAuthentication()
  • Method Details

    • getAuthorities

      public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
      Specified by:
      getAuthorities in interface org.springframework.security.core.Authentication
    • getCredentials

      public Object getCredentials()
      Specified by:
      getCredentials in interface org.springframework.security.core.Authentication
    • getDetails

      public Object getDetails()
      Specified by:
      getDetails in interface org.springframework.security.core.Authentication
    • getPrincipal

      public Object getPrincipal()
      Получает Principal.
      Specified by:
      getPrincipal in interface org.springframework.security.core.Authentication
      Returns:
      имя пользователя в системе.
    • isAuthenticated

      public boolean isAuthenticated()
      Проверяет аутентификацию в системе.
      Specified by:
      isAuthenticated in interface org.springframework.security.core.Authentication
      Returns:
      true, если аутентификация есть иначе - false
    • setAuthenticated

      public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException
      Устанавливает аутентификацию в системе
      Specified by:
      setAuthenticated in interface org.springframework.security.core.Authentication
      Parameters:
      isAuthenticated - значение аутентификации.
      Throws:
      IllegalArgumentException - выбрасывает в случае ошибки в аргументе.
    • getName

      public String getName()
      Specified by:
      getName in interface Principal