@Test public void shouldGetSubjectAsName() throws Exception { String token = JWT.create() .withSubject("1234567890") .sign(hmacAlgorithm); AuthenticationJsonWebToken auth = new AuthenticationJsonWebToken(token, verifier); assertThat(auth, is(notNullValue())); assertThat(auth.getName(), is(notNullValue())); assertThat(auth.getName(), is(instanceOf(String.class))); assertThat(auth.getName(), Matchers.<Object>is("1234567890")); }
@Override public String getName() { return decoded.getSubject(); }
AuthenticationJsonWebToken implements Authentication, JwtAuthentication { @Override public String getName() { return decoded.getSubject(); } }
AuthenticationJsonWebToken implements Authentication, JwtAuthentication { @Override public String getName() { return decoded.getSubject(); } AuthenticationJsonWebToken(String token, JWTVerifier verifier); }
AuthenticationJsonWebToken implements Authentication, JwtAuthentication { @Override public String getName() { return decoded.getSubject(); } AuthenticationJsonWebToken(String token, JWTVerifier verifier); @Override String getToken(); @Override String getKeyId(); @Override Authentication verify(JWTVerifier verifier); @Override Collection<? extends GrantedAuthority> getAuthorities(); @Override Object getCredentials(); @Override Object getDetails(); @Override Object getPrincipal(); @Override boolean isAuthenticated(); @Override void setAuthenticated(boolean isAuthenticated); @Override String getName(); }
AuthenticationJsonWebToken implements Authentication, JwtAuthentication { @Override public String getName() { return decoded.getSubject(); } AuthenticationJsonWebToken(String token, JWTVerifier verifier); @Override String getToken(); @Override String getKeyId(); @Override Authentication verify(JWTVerifier verifier); @Override Collection<? extends GrantedAuthority> getAuthorities(); @Override Object getCredentials(); @Override Object getDetails(); @Override Object getPrincipal(); @Override boolean isAuthenticated(); @Override void setAuthenticated(boolean isAuthenticated); @Override String getName();  }