TITLE: What is the classifying space of "G-bundles with connections"
QUESTION [38 upvotes]: Let $G$ be a (maybe Lie) group, and $M$ a space (perhaps a manifold).  Then a principal $G$-bundle over $M$ is a bundle $P \to M$ on which $G$ acts (by fiber-preserving maps), so that each fiber is a $G$-torsor (a $G$-action isomorphic, although not canonically so, to the action of $G$ on itself by multiplication).  A map of $G$-bundles is a bundle map that plays well with the actions.
Then I more-or-less know what the classifying space of $G$ is: it's some bundle $EG \to BG$ that's universal in the homotopy category of (principal) $G$-bundles.  I.e. any $G$-bundle $P \to M$ has a (unique up to homotopy) map $P\to EG$ and $M \to BG$, and conversely any map $M\to BG$ (up to homotopy) determines a (unique up to isomorphism) bundle $P \to M$ and by pulling back the obvious square.
At least this is how I think it works.  Wikipedia's description of $BG$ is here.
So, let $G$ be a Lie group and $M$ a smooth manifold.  On a $G$-bundle $P \to M$ I can think about connections.  As always, a connection should determine for each smooth path in $M$ a $G$-torsor isomorphism between the fibers over the ends of the path.  So in particular, a bundle-with-connection is a (smooth) functor from the path space of $M$ to the category of $G$-torsors.  But not all of these are connections: the value of holonomy along a path is an invariant up to "thin homotopy", which is essentailly homotopy that does not push away from the image of the curve.  So one could say that a bundle-with-connection is a smooth functor from the thin-homotopy-path-space.
More hands-on, a connection on $P \to G$ is a ${\rm Lie}(G)$-valued one-form on $P$ that is (1) invariant under the $G$ action, and (2) restricts on each fiber to the canonical ${\rm Lie}(G)$-valued one-form on $G$ that takes a tangent vector to its left-invariant field (thought of as an element of ${\rm Lie}(G)$).
Anyway, my question is: is there a "space" (of some sort) that classifies $G$-bundles over $M$ with connections?  By which I mean, the data of such a bundle should be the same (up to ...) as a map $M \to $ this space.  The category of $G$-torsors is almost right, but then the map comes not from $M$ but from its thin-homotopy path space.
Please re-tag as desired.

REPLY [7 votes]: There should be an answer to Theo's question in terms of universal connections, but I don't know it.
This universal connection is a connection on the universal principal $G$-bundle over $BG$, such that every $G$-bundle with connection over $M$ is isomorphic (as a bundle with connection) to the pullback of $EG$ along some map $M \to BG$.
I've never found an answer to the following immediate question: what is the correct equivalence relation on the space of maps from $M$ to $BG$, such that equivalence classes of maps are in one-to-one correspondence with isomorphism classes of $G$-bundles with connection over $M$. Does anybody know this?
Also, I wanted to remark that $G$-bundles with connection are not the same as smooth functors on the thin path groupoid of $M$. Assuming global smoothness, you'll only get connections on trivializable bundles. The full story is here: http://arxiv.org/abs/0705.0452.