Hi Jason,
I think a lot of trouble people have with using or applying macaroons
comes from trying to use them as a policy language for authentication
rather than as a means of proving authorization. If you think of
caveats as describing properties of the principal to be authorized---of
which authentication is a subset---, you're going to have a hard time;
if, instead, you consider them to be restrictions on when and how an
/already authorized principal/ may apply their authority, you'll
probably find they work well for your use case.
Macaroons are for proving authorization, not authentication.
At the core of each macaroon is a secret that's used to mint the root
macaroon. Think of this as the ultimate master key for the resource
associated with the secret. In the example you cite, this would be
Alice's bank account. Anyone in possession of this macaroon has total
authority over the bank account.
The natural remedy for this is to add caveats constraining when and how
the macaroon would be used. In the bank account example, we might only
give the macaroon to Alice after adding a caveat that the macaroon is
only valid with proper identification. Under the metaphor, this is a
form of a third-party caveat, where the macaroon requires a proof that
is filled in by some other macaroon. If Google were to put weight
behind standardizing macaroons (which would be awesome idea, by the
way), the bank could add the caveat requiring "Google says this is
al...@example.org", and Alice could authenticate to Google to receive a
discharge token that could be used for authorization at the bank.
Here's where the power of Macaroons comes in, if you work hard enough to
preserve the purity of the caveat verifiers: The bank teller (the
verifier under the metaphor) does not need to know a thing about how to
interpret this third party caveat or its discharge macaroon in order to
verify the proof tree end-to-end. With just a few standard caveats (the
only one you really need is something to capture and bound the passage
of time) you can build a verifier that can interoperate with arbitrarily
complex policies that may be piecewise enforced across a variety of
services, each embedding its own business logic for when authorization
is granted. Of course, I hope you don't build something that complex,
but the capability is there and will not complicate backend services.
Hope this helps!
-Robert
> macaroons/cd6b5eb5-0120-4646-b44d-936b62664ff7%
40googlegroups.com.