Wowza provides the source code for the different players that ship with each install. Take a look at the source code in [install-dir]/examples/LiveVideoStreaming/FlashRTMPPlayer/Live.flv and|or [install-dir]/examples/VideoOnDemandStreaming/FlashRTMPPlayer/VOD.flv
var username:String = "user1";
var password = "pass1";
You will find more code examples in the comments of these articles.
NOTE: These modules are compatible with the Wowza Streaming Engine Incoming Security > RTMP Publishing > Require Password Authentication setting. If you use this module, the RTMP Publishing setting must be set to Open.
The file-based query parameter authentication is basically a workaround for publishers that can't use the correct RTMP authentication process, so Incoming Security for RTMP does need to be set to open to allow this to happen. However, no publisher will be able to connect unless they pass valid credentials via the query parameters, e.g.