| | |
| | | import java.security.Key; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.core.GrantedAuthority; |
| | |
| | | import org.springframework.security.core.userdetails.User; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import com.pollex.pam.business.domain.TokenBlackList; |
| | | import com.pollex.pam.business.repository.TokenBlackListRepository; |
| | | |
| | | import tech.jhipster.config.JHipsterProperties; |
| | | |
| | | @Component |
| | |
| | | private final long tokenValidityInMilliseconds; |
| | | |
| | | private final long tokenValidityInMillisecondsForRememberMe; |
| | | |
| | | @Autowired |
| | | TokenBlackListRepository tokenBlackListRepository; |
| | | |
| | | public TokenProvider(JHipsterProperties jHipsterProperties) { |
| | | byte[] keyBytes; |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public boolean isBlackListToken(String jwt) { |
| | | Optional<TokenBlackList> tokenBlack = tokenBlackListRepository.findById(jwt); |
| | | return tokenBlack.isPresent(); |
| | | } |
| | | } |