Skip to content

JWTAuth Provider not working? #55

@hzitoun

Description

@hzitoun

How to parse JWT Token sent by Stomp JS client in the header using JWTAuth Provider ?

  • Java
 JWTAuth authProvider = JWTAuth.create(vertx, new JWTAuthOptions()
            .setPermissionsClaimKey("")
            .addPubSecKey(
                  new PubSecKeyOptions()
                        .setPublicKey(config().getString("public_key"))
                        .setAlgorithm(config().getString("algorithm"))
            ));

 StompServer server = StompServer.create(vertx, new StompServerOptions()
            .setSecured(true)
            .setPort(-1) // Disable the TCP port, optional
            .setWebsocketBridge(true) // Enable the web socket support
            .setWebsocketPath("/ws")) // Configure the web socket path, /stomp by default
            .handler(StompServerHandler.create(vertx).authProvider(authProvider));
  • Javascript
 const client = new Stomp.Client({
         brokerURL : 'url',
         connectHeaders : {
            Authorization : 'Bearer ' + <TOKEN>
         }
      });

Th jwtAuth provider works fine with my HTTP routes, but not with my WebSocket.

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions