Macaroon can do this for you