|
|
@ -6,9 +6,12 @@ import org.springframework.security.core.GrantedAuthority; |
|
|
|
import java.util.Collection; |
|
|
|
import java.util.Collection; |
|
|
|
|
|
|
|
|
|
|
|
public class JWTAuthenticationToken extends AbstractAuthenticationToken { |
|
|
|
public class JWTAuthenticationToken extends AbstractAuthenticationToken { |
|
|
|
|
|
|
|
|
|
|
|
private final String token; |
|
|
|
private final String token; |
|
|
|
private String requestedPath; |
|
|
|
private String requestedPath; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static final String USERNAME_ANONYMOUS = "anonymous"; |
|
|
|
|
|
|
|
|
|
|
|
public JWTAuthenticationToken(Collection<? extends GrantedAuthority> authorities, String token, String requestedPath) { |
|
|
|
public JWTAuthenticationToken(Collection<? extends GrantedAuthority> authorities, String token, String requestedPath) { |
|
|
|
super(authorities); |
|
|
|
super(authorities); |
|
|
|
this.token = token; |
|
|
|
this.token = token; |
|
|
@ -22,7 +25,7 @@ public class JWTAuthenticationToken extends AbstractAuthenticationToken { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Object getPrincipal() { |
|
|
|
public Object getPrincipal() { |
|
|
|
return "GERNIC_JWT_PRINICPLE"; |
|
|
|
return USERNAME_ANONYMOUS; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getRequestedPath() { |
|
|
|
public String getRequestedPath() { |
|
|
|