If you are just opening a web layout you defined in Studio, you can pass an undocumented parameter at the URL to get around this. Append &USERNAME=Anonymous to the URL. If you want to use a different username that has a password you can also append &PASSWORD= to the URL.
You could alternatively modify the mainframe.php/.aspx/.jsp file found under your webserverextensions/www/mapviewerxxx folder depending on your API language. You could modify the username variable at the top of the file and set it to Anonymous.
Regards,
Dave