There is this map that allows you to do just that with ease, created by Anil Polat, it shows WiFi hotspot in airports around the world. The hotspot are marked with a plane icon and clicking them will gives you its SSID and password.
Most of the WiFi Internet hotspots information are user contributed, meaning it is constantly updated with the help of other users. Think of it as a crowdsourced project where anyone can contribute and benefits.
While the map are free to use, you can also show your support to the author by getting an app version of the map for $1.99 in Google Play Store, Apple App Store and Amazon Store. Through the app, you can download the hotspots for offline use, as well as in a searchable list view.
Now, if you end up using the map or app to connect to a WiFi hotspot, don’t forget to share with the author any airport or lounge wireless passwords that you come across. This will certainly help other users.