A Option you can have is to build your secure layers in a seperate instance of ArcGIS, then acess this via proxy, Then force that layer to load by LayerDefinitions; then build that list of layer definitions based on your security provider.
My current project relies on a custom single-sign-on solution, then once the user is authenticated they are passed to the MapViewer which has the critical layers load dynamically into the map based on code that looks at there rights and capabilites via there login-token and sets the layerdefs appropriatley.
All of my standard base stuff is exposed via a public instance; but then the secured users load there layers based on industry/group assignments.