Barnabe Rich was an English soldier in the 15th century, about 24 years older than Shakespeare, as well as a writer. He is particularly known for his work Riche his Farewell to Militarie Profession conteining verie pleasaunt discourses fit for a peaceable tyme, published in 1581, about 20 years prior to Twelfth Night. It contains eight different stories, most of which are fictional. One of those stories is titled "Apolonius and Silla," and it most certainly was a work that Shakespeare drew on for his creation of Twelfth Night ("Barnabe Rich"). However, Rich's "Apolonius and Silla" actually was not an original work with an original plot. Rich most likely used the Italian play Gl'Ingannati, translating to The Deceived, which was written by an anonymous author and published in 1537, 44 years prior to Rich's work (Lockett, "A final paper for: 'Shakespeare's Sources'").
While Rich most likely drew his inspiration from Gl'Ingannati, it is evident that Shakespeare's own Twelfth Night is closer in similarity to Rich's work. However, one similarity between Twelfth Night and Gl'Ingannati is that the heroine, disguised as a boy, falls in love with Flaminio after she begins working for him, just like Viola disguised as Cesario falls in love with Duke Orsino after she begins working for him. We first learn that Viola has fallen in love with Duke Orsino in the fourth scene of the first act when Orsino sends her to Olivia as his messenger, and to herself she says, "Yet, a barful strife! / Whoe'er I woo, myself would be his wife," meaning that it is a difficult task for her to court Olivia on Orsino's behalf for she would like to be his wife herself (I.iv.42-43). In contrast, in "Apolonius and Silla," Silla falls in love with Duke Apolonius at the very beginning. Her pursuit of him is actually a contributing factor to the shipwreck she survives that is also mentioned in Shakespeare's work. After surviving the shipwreck, she then goes to work for him disguised as her brother, even using her brother's name Silvo/Silvio ("Shakespeare's Main Sources").
Another similarity between Twelfth Night and Gi'Ingannati is that both heroines disguise themselves as boys in general and then their identity is later exposed by their twin brothers. In contrast, in "Aplonius and Silla," Silla assumes the identity of her brother, even taking his name, while both heroines in the other two plays use names that are different from their own brothers' names("Shakespeare's Main Sources").
One similarity between all three works is that the hero is in love with another woman and sends the heroine to court her on his behalf, but he eventually marries the heroine, while the heroine's twin brother marries the woman the hero was in love with at the start ("Shakespeare's Main Sources").