While we don't know the author of the Gospel of John for sure, most scholars believe it was written by
the apostle John, one of Jesus's closest disciples.
Therefore, it's generally accepted that John himself is the author of John 2, as well as the entire Gospel of John.