All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mercateo.spring.security.jwt.token.keyset.Auth0JWTKeyset Maven / Gradle / Ivy

package com.mercateo.spring.security.jwt.token.keyset;

import com.auth0.jwk.GuavaCachedJwkProvider;
import com.auth0.jwk.Jwk;
import com.auth0.jwk.JwkProvider;
import com.auth0.jwk.UrlJwkProvider;
import io.vavr.control.Try;

public class Auth0JWTKeyset implements JWTKeyset {

    private JwkProvider provider;

    public Auth0JWTKeyset(String auth0Domain) {
        JwkProvider http = new UrlJwkProvider("https://" + auth0Domain);
        provider = new GuavaCachedJwkProvider(http);
    }

    @Override
    public Try getKeysetForId(String keyId) {
        return Try.of(() -> provider.get(keyId));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy