本文整理汇总了Java中io.vertx.ext.web.handler.JWTAuthHandler类的典型用法代码示例。如果您正苦于以下问题:Java JWTAuthHandler类的具体用法?Java JWTAuthHandler怎么用?Java JWTAuthHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JWTAuthHandler类属于io.vertx.ext.web.handler包,在下文中一共展示了JWTAuthHandler类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jwtAuthHandler
import io.vertx.ext.web.handler.JWTAuthHandler; //导入依赖的package包/类
private JWTAuthHandler jwtAuthHandler() {
JsonObject authConfig = new JsonObject().put("keyStore", new JsonObject()
.put("type", "jceks")
.put("path", "keystore.jceks")
.put("password", "secret"));
JWTAuth authProvider = JWTAuth.create(vertx, authConfig);
return JWTAuthHandler.create(authProvider);
}
示例2: AuthenticationFactory
import io.vertx.ext.web.handler.JWTAuthHandler; //导入依赖的package包/类
public AuthenticationFactory(Config config) {
this.config = config;
authHandlers = new EnumMap<>(AuthMethod.class);
authHandlers.put(BASIC, BasicAuthHandler::create);
authHandlers.put(JWT, auth -> JWTAuthHandler.create((JWTAuth)config.getAuthProvider()));
authHandlers.put(API_TOKEN, CheckTokenHandler::new);
}
示例3: SubRouterFactoryImpl
import io.vertx.ext.web.handler.JWTAuthHandler; //导入依赖的package包/类
private SubRouterFactoryImpl(JWTAuth jwtProvider){
this.jwtProvider = jwtProvider;
this.jwtHandler = JWTAuthHandler.create(jwtProvider);
}
示例4: setAudience
import io.vertx.ext.web.handler.JWTAuthHandler; //导入依赖的package包/类
@Override
public JWTAuthHandler setAudience(List<String> audience) {
options.put("audience", new JsonArray(audience));
return this;
}
示例5: setIssuer
import io.vertx.ext.web.handler.JWTAuthHandler; //导入依赖的package包/类
@Override
public JWTAuthHandler setIssuer(String issuer) {
options.put("issuer", issuer);
return this;
}
示例6: setIgnoreExpiration
import io.vertx.ext.web.handler.JWTAuthHandler; //导入依赖的package包/类
@Override
public JWTAuthHandler setIgnoreExpiration(boolean ignoreExpiration) {
options.put("ignoreExpiration", ignoreExpiration);
return this;
}
示例7: setAudience
import io.vertx.ext.web.handler.JWTAuthHandler; //导入依赖的package包/类
@Override
public JWTAuthHandler setAudience(List<String> audience) {
options.put("audience", new JsonArray(audience));
return this;
}
示例8: setIssuer
import io.vertx.ext.web.handler.JWTAuthHandler; //导入依赖的package包/类
@Override
public JWTAuthHandler setIssuer(String issuer) {
options.put("issuer", issuer);
return this;
}
示例9: setIgnoreExpiration
import io.vertx.ext.web.handler.JWTAuthHandler; //导入依赖的package包/类
@Override
public JWTAuthHandler setIgnoreExpiration(boolean ignoreExpiration) {
options.put("ignoreExpiration", ignoreExpiration);
return this;
}
示例10: addJWT
import io.vertx.ext.web.handler.JWTAuthHandler; //导入依赖的package包/类
public void addJWT(OpenAPI3RouterFactory routerFactory, JWTAuth jwtAuthProvider) {
routerFactory.addSecurityHandler("jwt_auth", JWTAuthHandler.create(jwtAuthProvider));
}
示例11: authHandler
import io.vertx.ext.web.handler.JWTAuthHandler; //导入依赖的package包/类
protected AuthHandler authHandler(){
return JWTAuthHandler.create(my(JWTAuthFactory.class).getJWTAuth());
}