We have a service that does exactly that. It's at
https://github.com/CanonicalLtd/candid.
The clients don't have a special case for this service. Instead, we
have a standard macaroon discharge protocol that allows a server to
request more information to complete a discharge. The discharge
protocol is briefly described here:
https://godoc.org/gopkg.in/macaroon-bakery.v2/httpbakery#Discharger
and in a work-in-progress specification here:
https://docs.google.com/document/d/1e2Jj4iWxMVVx6KCCBmpyMd8KA-PUDFiqULmr3nmvpqo.
We have Go, Python and Javascript code that supports the protocol.
An old version of the Candid server is running at
https://api.jujucharms.com/identity and there's the more recent
version running at
https://api.staging.jujucharms.com/identity (it
will become current once we've worked through a few backward
compatibility issues, RSN :-])
In summary, when a server gets a discharge request and the client
hasn't provided enough information for the server to decide whether to
provide the discharge macaroon, the server can return an "interaction
required" error containing a list of possible protocols that the
client can choose to follow to acquire the macaroon. The result of
following an interaction protocol is a "discharge token" that the
client can present to the discharge endpoint to acquire the discharge
macaroon.
If you're interested, I can go into more detail. We have a white paper
in progress that's long overdue...
cheers,
rog.