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

io.vertx.up.secure.provider.JwtAuth Maven / Gradle / Ivy

There is a newer version: 0.9.0
Show newest version
package io.vertx.up.secure.provider;

import io.vertx.core.Vertx;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.auth.AuthProvider;
import io.vertx.ext.auth.jwt.JWTAuthOptions;
import io.vertx.ext.jwt.JWTOptions;
import io.vertx.up.secure.Security;

import java.util.function.Supplier;

public interface JwtAuth extends AuthProvider {

    static JwtAuth create(final Vertx vertx,
                          final JWTAuthOptions config) {
        return new JwtAuthProvider(vertx, config);
    }

    JwtAuth bind(Supplier security);

    String generateToken(JsonObject data, JWTOptions options);

    default String generateToken(final JsonObject claims) {
        return this.generateToken(claims, new JWTOptions());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy