@Test public void testCreateAuthFilterReturnsAnAuthFilter() { final String secretKey = TestHelpers.generateBase64SecretKey(); final JsonWebTokenConfig jwtConfig = new JsonWebTokenConfig(secretKey); final AuthenticationBootstrap authBootstrap = TestHelpers.createTypicalAuthBootstrap(); final AuthFilter ret = jwtConfig.createAuthFilter(authBootstrap); assertThat(ret).isNotNull(); }
@Override public AuthFilter<?, Principal> createAuthFilter(AuthenticationBootstrap bootstrap) { final byte[] decodedSecretKey = Base64.getDecoder().decode(secretKey); final Key secretKeyKey = new SecretKeySpec(decodedSecretKey, 0, decodedSecretKey.length, this.getSignatureAlgorithm().toString()); return new JsonWebTokenAuthFilter.Builder<>() .setAuthenticator(new JsonWebTokenAuthenticator(secretKeyKey, this.getSignatureAlgorithm())) .setAuthorizer(new PermitAllAuthorizer()) .buildAuthFilter(); }
JsonWebTokenConfig implements AuthenticationConfig { @Override public AuthFilter<?, Principal> createAuthFilter(AuthenticationBootstrap bootstrap) { final byte[] decodedSecretKey = Base64.getDecoder().decode(secretKey); final Key secretKeyKey = new SecretKeySpec(decodedSecretKey, 0, decodedSecretKey.length, this.getSignatureAlgorithm().toString()); return new JsonWebTokenAuthFilter.Builder<>() .setAuthenticator(new JsonWebTokenAuthenticator(secretKeyKey, this.getSignatureAlgorithm())) .setAuthorizer(new PermitAllAuthorizer()) .buildAuthFilter(); } }
JsonWebTokenConfig implements AuthenticationConfig { @Override public AuthFilter<?, Principal> createAuthFilter(AuthenticationBootstrap bootstrap) { final byte[] decodedSecretKey = Base64.getDecoder().decode(secretKey); final Key secretKeyKey = new SecretKeySpec(decodedSecretKey, 0, decodedSecretKey.length, this.getSignatureAlgorithm().toString()); return new JsonWebTokenAuthFilter.Builder<>() .setAuthenticator(new JsonWebTokenAuthenticator(secretKeyKey, this.getSignatureAlgorithm())) .setAuthorizer(new PermitAllAuthorizer()) .buildAuthFilter(); } JsonWebTokenConfig();  JsonWebTokenConfig(String secretKey); }
JsonWebTokenConfig implements AuthenticationConfig { @Override public AuthFilter<?, Principal> createAuthFilter(AuthenticationBootstrap bootstrap) { final byte[] decodedSecretKey = Base64.getDecoder().decode(secretKey); final Key secretKeyKey = new SecretKeySpec(decodedSecretKey, 0, decodedSecretKey.length, this.getSignatureAlgorithm().toString()); return new JsonWebTokenAuthFilter.Builder<>() .setAuthenticator(new JsonWebTokenAuthenticator(secretKeyKey, this.getSignatureAlgorithm())) .setAuthorizer(new PermitAllAuthorizer()) .buildAuthFilter(); } JsonWebTokenConfig();  JsonWebTokenConfig(String secretKey); String getSecretKey(); SignatureAlgorithm getSignatureAlgorithm(); @Override AuthFilter<?, Principal> createAuthFilter(AuthenticationBootstrap bootstrap); }
JsonWebTokenConfig implements AuthenticationConfig { @Override public AuthFilter<?, Principal> createAuthFilter(AuthenticationBootstrap bootstrap) { final byte[] decodedSecretKey = Base64.getDecoder().decode(secretKey); final Key secretKeyKey = new SecretKeySpec(decodedSecretKey, 0, decodedSecretKey.length, this.getSignatureAlgorithm().toString()); return new JsonWebTokenAuthFilter.Builder<>() .setAuthenticator(new JsonWebTokenAuthenticator(secretKeyKey, this.getSignatureAlgorithm())) .setAuthorizer(new PermitAllAuthorizer()) .buildAuthFilter(); } JsonWebTokenConfig();  JsonWebTokenConfig(String secretKey); String getSecretKey(); SignatureAlgorithm getSignatureAlgorithm(); @Override AuthFilter<?, Principal> createAuthFilter(AuthenticationBootstrap bootstrap);  }