Is there a way to assign a material to a vertex group without the vertex group being editable mesh data?
In this case, the modifier provides a Material Index Offset setting for generated geometry.. (just above the Vertex Group assignments)  so you don't need any get-arounds..

(This circle is solidified downwards, from red to blue)
In general, until a node is provided, this method by @Nathan can get vertex-groups / weights into shader trees.