TITLE: Stiefel–Whitney classes in the spirit of Chern-Weil
QUESTION [62 upvotes]: Chern-Weil theory gives characteristic classes (e.g. Chern class, Euler class, Pontryagin) of a vector bundle in terms of polynomials in the curvature form of an arbitrary connection.  There seems to be no hope in getting Stiefel-Whitney classes from this method since Chern-Weil gives cohomology classes with real coefficients while Stiefel-Whitney classes have $\mathbb Z/2$ coefficients.  Further, since any vector bundle over a curve has vanishing curvature, classes obtained by Chern-Weil can't distinguish, for example, the Mobius bundle from the trivial bundle over the circle (while Stiefel-Whitney classes do).
Nonetheless, I am wondering if there is a more general or abstract framework that allows one to define the Stiefel-Whitney classes in the spirit of Chern-Weil.  For example, maybe this is done through a more abstract definition of a connection/curvature.

REPLY [4 votes]: There exist flat manifolds (i.e., closed Riemannian manifolds with vanishing sectional curvature) which do not admit any spin or spin${}^c$-structure. But since the existence of spin, resp. of spin${}^c$-structures is detected by the second Stiefel-Whitney class, I am strongly led to believe that there is no way of defining these à la Chern-Weil. The reason is that the phrase 'à la Chern-Weil' entails for me that you use in an essential way the curvature tensor, but in these examples it vanishes.