Authenticating to model on shared controller
Tim Van Steenburgh
tim.van.steenburgh at canonical.com
Sat Nov 5 23:56:07 UTC 2016
Thanks Francesco - I didn't realize that the base64-decoded value was in
fact the
json-serialized macaroon.
Now I have valid macaroons, but I'm still getting the "redirection
required" error
message back from the Login api, and I have no idea why. Digging around in
juju
code trying to figure it out, but if anyone has any pointers that'd be
great.
On Sat, Nov 5, 2016 at 6:44 PM, Francesco Banconi <
francesco.banconi at canonical.com> wrote:
>
> > On 5 Nov 2016, at 23:07, Tim Van Steenburgh <
> tim.van.steenburgh at canonical.com> wrote:
> >
> > Can anyone tell me how the macaroons in ~/.go-cookies are encoded? If I
> try to
> > deserialize the 'Value' value directly (using libmacaroons), I get an
> 'invalid macaroon'
> > error. I also tried base64-decoding the value first, and that didn't
> work either.
>
> Decoding the cookie values with base64 should work for that.
> I just quickly tested that the following works locally with Python3 for
> instance:
>
> import base64, json, os
> cookies = json.load(open(os.path.expanduser('~/.go-cookies')))
> values = [c['Value'] for c in cookies if c['Name'].startswith('macaroon-')
> and c['Value']]
> macaroons = [json.loads(base64.b64decode(value).decode('utf-8')) for
> value in values]
>
> --
> Francesco
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20161105/6f5fd313/attachment.html>
More information about the Juju
mailing list