|SecureNet Xtra for Director||Windows & Mac||Proxy Authentication||All|
When you are publishing content for an unknown audience and you don't know the end-user's configuration, call snxProxyServer() using the #Default parameter (syntax 4 in the User manual). This tells SecureNet Xtra to use the user's default Internet configuration in all subsequent Internet operations. Note that this method does not actually query any URL and therefore does not test if the settings work.
To test if the default settings work, as is, or if there is a proxy server that requires username and password authentication, you must perform an HTTP operation, such as snxGetNetText and see if an error code is returned. Through testing we found that it is best to check the snxNetError(gNetID) error code after snxNetDone(gNetID) becomes TRUE.
Error code -407 is an HTTP error: the requested resource requires user authentication. User name and/or password may be absent or incorrect in the URL.
Error code -1203 is an Internet Library error: The user name and/or the password defined with the snxProxyServer are not accepted by the proxy server.
Either of these error codes indicate that a user name and/or password are required. Your application can then display a dialog box requesting this information from the user.
The sample movie Test Proxy Authentication, available below, demonstrates how to check for the error code returned from a SecureNet Xtra operation, in asynchronous mode. If proxy server authentication is required, it displays a MUI dialog box, allowing the user to enter this information at runtime.
This Director 7 movie runs on Windows, Mac Classic and in Director MX on Mac OS X.
Test Proxy Authentication: this sample runs on Director 7 and later.