style(simple-jwt): Upgraded method to get Algorithm declared in third-party implementation.
This commit is contained in:
+1
-1
@@ -140,7 +140,7 @@ public class AuthzeroTokenResolver implements TokenResolver<DecodedJWT> {
|
||||
throw new IllegalArgumentException("A secret is required to build a JSON Web Token.");
|
||||
}
|
||||
this.jtiCreator = jtiCreator;
|
||||
this.algorithm = AuthzeroTokenResolverConfig.getInstance().getFunction(algorithm).apply(secret);
|
||||
this.algorithm = AuthzeroTokenResolverConfig.getInstance().getAlgorithm(algorithm).apply(secret);
|
||||
this.issuer = issuer;
|
||||
this.verifier = JWT.require(this.algorithm).build();
|
||||
}
|
||||
|
||||
+1
-1
@@ -140,7 +140,7 @@ public final class AuthzeroTokenResolverConfig implements TokenResolverConfig<Fu
|
||||
* implementation
|
||||
*/
|
||||
@Override
|
||||
public Function<String, Algorithm> getFunction(TokenAlgorithm algorithm) {
|
||||
public Function<String, Algorithm> getAlgorithm(TokenAlgorithm algorithm) {
|
||||
return Optional.of(SUPPORTED_ALGORITHMS).map((entry) -> entry.get(algorithm))
|
||||
.orElseThrow(() -> new UnsupportedAlgorithmException("The specified algorithm is not supported yet."));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user