We wish to manage the authentication separately, Once a user is logged into our system, they should not be presented with any authentication prompts.
With the Silverlight API we simply added a Token to the Layer.
Please refer to this URL for a sample : http://jsfiddle.net/caseycupp/4f34s5ct/6/
// Test 1 - Adding unsecured service : This works. I'm adding one layer to the map and the legend.
// Test 2 - Testing service with token : If I comment line 77 and uncomment line 79 to try to add a Secure Layer instantiated with a token to the legend. The layer is added to the map but not the legend
// Test 3 - Testing service with token : If I revert to Test 1(uncomment line 77 and comment 79) and then uncomment the section from 50-57 the credential object never gets added to the layer. (as you can see the alert fails)