Search in sources :

Example 6 with PubSecKeyOptions

use of io.vertx.ext.auth.PubSecKeyOptions in project vertx-auth by vert-x3.

the class AuthJWTExamples method example17.

public void example17(Vertx vertx) {
    JWTAuth provider = JWTAuth.create(vertx, new JWTAuthOptions().addPubSecKey(new PubSecKeyOptions().setAlgorithm("ES256").setSecretKey("MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgeRyEfU1NSHPTCuC9\n" + "rwLZMukaWCH2Fk6q5w+XBYrKtLihRANCAAStpUnwKmSvBM9EI+W5QN3ALpvz6bh0\n" + "SPCXyz5KfQZQuSj4f3l+xNERDUDaygIUdLjBXf/bc15ur2iZjcq4r0Mr")));
    String token = provider.generateToken(new JsonObject(), new io.vertx.ext.jwt.JWTOptions().setAlgorithm("ES256"));
}
Also used : JWTAuthOptions(io.vertx.ext.auth.jwt.JWTAuthOptions) PubSecKeyOptions(io.vertx.ext.auth.PubSecKeyOptions) JsonObject(io.vertx.core.json.JsonObject) JWTOptions(io.vertx.ext.auth.jwt.JWTOptions) JWTAuth(io.vertx.ext.auth.jwt.JWTAuth)

Example 7 with PubSecKeyOptions

use of io.vertx.ext.auth.PubSecKeyOptions in project vertx-auth by vert-x3.

the class AuthJWTExamples method example18.

public void example18(Vertx vertx) {
    JWTAuth provider = JWTAuth.create(vertx, new JWTAuthOptions().addPubSecKey(new PubSecKeyOptions().setAlgorithm("ES256").setPublicKey("MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEraVJ8CpkrwTPRCPluUDdwC6b8+m4\n" + "dEjwl8s+Sn0GULko+H95fsTREQ1A2soCFHS4wV3/23Nebq9omY3KuK9DKw==\n").setSecretKey("MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgeRyEfU1NSHPTCuC9\n" + "rwLZMukaWCH2Fk6q5w+XBYrKtLihRANCAAStpUnwKmSvBM9EI+W5QN3ALpvz6bh0\n" + "SPCXyz5KfQZQuSj4f3l+xNERDUDaygIUdLjBXf/bc15ur2iZjcq4r0Mr")));
    String token = provider.generateToken(new JsonObject(), new io.vertx.ext.jwt.JWTOptions().setAlgorithm("ES256"));
}
Also used : JWTAuthOptions(io.vertx.ext.auth.jwt.JWTAuthOptions) PubSecKeyOptions(io.vertx.ext.auth.PubSecKeyOptions) JsonObject(io.vertx.core.json.JsonObject) JWTOptions(io.vertx.ext.auth.jwt.JWTOptions) JWTAuth(io.vertx.ext.auth.jwt.JWTAuth)

Example 8 with PubSecKeyOptions

use of io.vertx.ext.auth.PubSecKeyOptions in project vertx-auth by vert-x3.

the class AuthJWTExamples method example16.

public void example16(Vertx vertx) {
    JWTAuth provider = JWTAuth.create(vertx, new JWTAuthOptions().addPubSecKey(new PubSecKeyOptions().setAlgorithm("HS256").setPublicKey("keyboard cat").setSymmetric(true)));
    String token = provider.generateToken(new JsonObject());
}
Also used : JWTAuthOptions(io.vertx.ext.auth.jwt.JWTAuthOptions) PubSecKeyOptions(io.vertx.ext.auth.PubSecKeyOptions) JsonObject(io.vertx.core.json.JsonObject) JWTAuth(io.vertx.ext.auth.jwt.JWTAuth)

Aggregations

PubSecKeyOptions (io.vertx.ext.auth.PubSecKeyOptions)8 JWTAuthOptions (io.vertx.ext.auth.jwt.JWTAuthOptions)5 JsonObject (io.vertx.core.json.JsonObject)4 JWTAuth (io.vertx.ext.auth.jwt.JWTAuth)4 JWTOptions (io.vertx.ext.auth.jwt.JWTOptions)3 Buffer (io.vertx.core.buffer.Buffer)1 FileSystemException (io.vertx.core.file.FileSystemException)1 AuthProvider (io.vertx.ext.auth.AuthProvider)1 KeyStoreOptions (io.vertx.ext.auth.KeyStoreOptions)1 SecretOptions (io.vertx.ext.auth.SecretOptions)1 OAuth2ClientOptions (io.vertx.ext.auth.oauth2.OAuth2ClientOptions)1 OAuth2AuthProviderImpl (io.vertx.ext.auth.oauth2.impl.OAuth2AuthProviderImpl)1 JWK (io.vertx.ext.jwt.JWK)1 JWT (io.vertx.ext.jwt.JWT)1 io.vertx.up.exception._500JwtRuntimeException (io.vertx.up.exception._500JwtRuntimeException)1 JwtAuthProvider (io.vertx.up.secure.provider.JwtAuthProvider)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 KeyStore (java.security.KeyStore)1