Language: Java
Label: safe
CWE: CWE-287 \u2014 Improper Authentication
When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.

Code:
  public void setUp(TestContext context) {
    vertx = rule.vertx();
    AuthenticationProvider provider = PropertyFileAuthentication.create(vertx, "test-auth.properties");
    server = StompServer.create(vertx, new StompServerOptions()
        .setSecured(true)
        .setWebsocketBridge(true)
        .setWebsocketPath("/stomp"))
      .handler(StompServerHandler.create(vertx).authProvider(provider));
    server.listen(StompServerOptions.DEFAULT_STOMP_PORT).onComplete(context.asyncAssertSuccess());
    wsServer = vertx.createHttpServer(new HttpServerOptions().setWebSocketSubProtocols(Arrays.asList("v10.stomp", "v11.stomp")))
      .webSocketHandler(server.webSocketHandler());
    wsServer.listen(8080).onComplete(context.asyncAssertSuccess());
    wsClient = vertx.createHttpClient();
    client = StompClient.create(vertx, new StompClientOptions().setLogin("admin").setPasscode("admin"));
  }