You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Jason Smith <jh...@apache.org> on 2013/07/29 04:42:56 UTC

Persona and BrowserID integration

(Breaking off from the "IRC meeting" thread.)

Credit where it's due: The initial push for Persona in CouchDB came
from Randall Leeds.

Dirkjan says to use the hosted include.js file instead of serving it
internally. I kind of agree, but note that CouchDB hosts its own
JQuery. The priority is not that we match the latest spec, the
priority is that people can log in.

CouchDB should support disconnected operation. Where possible, we
should be able to authenticate without depending on a third-party over
the Internet. However I would like to achieve that by various
milestones of partial completion.

There are two (known) areas where my implementation relies on third parties.

1. The include.js file
2. Validating the client signature over browserid.org/verify

At this time, for #1 we host our own copy, and for #2 we outsource to
the browserid.org web service, so that is inconsistent. I am thinking
of the following milestones:

1. Everything outsourced.
  * Link to browserid.org for include.js
  * Call out to browserid.org for signature validation
2. Erlang implementation of signature validation. This will take some
R&D, could be a nice newbie project
3. Once Couch can do all the crypto "in-house," provide an option to
use either the self-contained implementation or else the
Internet-ready implementation. Most Persona logins will be to an
Internet server with a gmail.com address.

My definition of success:

1. Install CouchDB on a LAN
2. Install a free software identity provider (IdP)
3. Disconnect the LAN
4. Create email accounts
5. Authenticate to CouchDB over BrowserID

Re: Persona and BrowserID integration

Posted by Jason Smith <ja...@gmail.com>.
My guess is "preferred" will depend on the usage type. Frankly IMO to
a first approximation, nobody uses disconnected operation anymore. (At
least, if they do, they have the resources to fork CouchDB.)

In practice, hosting a copy of include.js has been problematic. Logins
break every month or two. "Outsourced" mode will be more useful, for
sure.

However I think CouchDB has a moral duty to support disconnected
operation. So that is why both modes are in my plan.

On Mon, Jul 29, 2013 at 10:12 AM, Alexander Shorin <kx...@gmail.com> wrote:
> Hi Jason,
>
> I think having "all in house" solution is preferred since it will
> allow private local area networks to use such auth for CouchDB without
> need to access some remote resources. With browserid / persona it will
> be possible to have CouchDB as auth server for other instances, right?
> --
> ,,,^..^,,,
>
>
> On Mon, Jul 29, 2013 at 6:42 AM, Jason Smith <jh...@apache.org> wrote:
>> (Breaking off from the "IRC meeting" thread.)
>>
>> Credit where it's due: The initial push for Persona in CouchDB came
>> from Randall Leeds.
>>
>> Dirkjan says to use the hosted include.js file instead of serving it
>> internally. I kind of agree, but note that CouchDB hosts its own
>> JQuery. The priority is not that we match the latest spec, the
>> priority is that people can log in.
>>
>> CouchDB should support disconnected operation. Where possible, we
>> should be able to authenticate without depending on a third-party over
>> the Internet. However I would like to achieve that by various
>> milestones of partial completion.
>>
>> There are two (known) areas where my implementation relies on third parties.
>>
>> 1. The include.js file
>> 2. Validating the client signature over browserid.org/verify
>>
>> At this time, for #1 we host our own copy, and for #2 we outsource to
>> the browserid.org web service, so that is inconsistent. I am thinking
>> of the following milestones:
>>
>> 1. Everything outsourced.
>>   * Link to browserid.org for include.js
>>   * Call out to browserid.org for signature validation
>> 2. Erlang implementation of signature validation. This will take some
>> R&D, could be a nice newbie project
>> 3. Once Couch can do all the crypto "in-house," provide an option to
>> use either the self-contained implementation or else the
>> Internet-ready implementation. Most Persona logins will be to an
>> Internet server with a gmail.com address.
>>
>> My definition of success:
>>
>> 1. Install CouchDB on a LAN
>> 2. Install a free software identity provider (IdP)
>> 3. Disconnect the LAN
>> 4. Create email accounts
>> 5. Authenticate to CouchDB over BrowserID

Re: Persona and BrowserID integration

Posted by Jan Lehnardt <ja...@apache.org>.
(not in reply to any one mail in particular)

+1 on shipping a first version with support for the official Persona
service.

Let’s wait for concrete feature requests for “offline” scenarios,
should they emerge.

Jan
--



On Jul 29, 2013, at 11:03 , Dirkjan Ochtman <di...@ochtman.nl> wrote:

> On Mon, Jul 29, 2013 at 6:13 AM, Jason Smith <ja...@gmail.com> wrote:
>> Thanks, Jim. That is basically my plan. To be clear, I would ship
>> "outsourced mode" (browserid.org hosted JavaScript and verification)
>> in a CouchDB release. It's just that I would work to get "tinfoil hat
>> mode" added in for a subsequent release. Outsourced mode already
>> exists (modulo a rewrite and unit tests) as a plugin, but I want to
>> merge it in.
> 
> Running the verification inside CouchDB is very sane. It looks like
> local verification will be the recommended approach anyway in the near
> future.
> 
>> I am not sure if I understand you exactly. Persona is a three-party
>> protocol between users, relying parties (RPs) and identity providers
>> (IdPs). I am talking about RP support for CouchDB. AFAIK there is a
>> bit of mere-mortal cypto to do but it does not require IdP support.
> 
> Your tinfoil hat mode is a bit weird. If you're doing disconnected
> operation, you can only connect to Identity Providers inside the LAN,
> so general RP support becomes impossible, so it's a pretty crippled
> setup.
> 
> Cheers,
> 
> Dirkjan


Re: Persona and BrowserID integration

Posted by Dale Harvey <da...@arandomurl.com>.
> Dale, what do you think about the value of "official" Persona support
> in CouchDB, versus the possibility that it becomes a plugin "killer
> app" or at least a decent reference implementation?

Are you asking whether I think it should be always be in core vs being a
plugin? or should we have some 'blessed' official plugins vs wild west.

In terms of being in core I think its one of various auth options, but its
not so much a value judgement and more that it can be a plugin, and I think
if it can be a plugin it should be, nothing to do with how useful it is, as
said I love browser_id and will be installing it on every instance I run
but I am worried about the fact that every thing we add to core adds more
work in terms of agreeing details about implementation, support for an ever
growing api, artificial release delays and other problems, I want to see
this type of functionality available to users (me) when you write it.

As for 'blessed plugins' vs wild west, I can see it useful to having a set
of maintained plugins that are testing with each release and signified as
such, not sure its absolutely required though, and I do think installing
arbitrary plugins needs to be possible.

Yeh given that a one click plugin system is fairly ambitious and this
plugin has been around for ages, I think its reasonable to merge it before
the plugin system is ready, but doing it with the goal of removing it to a
plugin and using it to think about the implications / api and coming up
with a plugin plan I think is useful



On 29 July 2013 18:01, Jan Lehnardt <ja...@apache.org> wrote:

>
> On Jul 29, 2013, at 18:29 , Jason Smith <jh...@apache.org> wrote:
>
> >
> > On Mon, Jul 29, 2013 at 11:24 PM, Dirkjan Ochtman <di...@ochtman.nl>
> wrote:
> >> On Mon, Jul 29, 2013 at 5:24 PM, Dale Harvey <da...@arandomurl.com>
> wrote:
> >>> On the topic of browser_id support in CouchDB, it feels like this is a
> big
> >>> chance to push for usable plugins, should the aim for this not to be
> >>> included into core but to be available as a one click install from
> >>> futon/fauxton (this and geocouch seem prime candidates)?
> >>
> >> Yeah, I think that would be good. For me, the primary motivation would
> >> be that CouchDB shouldn't grow a kitchen sink.
>
> +1
>
>
> >> On the other hand, one click installs from F(u|aux)ton sounds kind of
> ambitious!
>
> Oh yes, and so worth it :)
>
>
> > Given how old this plugin is (it came out right after BrowserID was
> > announced IIRC), I kind of want to merge it in, then refactor it out
> > if/when plugins improve.
>
> I want plugins badly, but let’s not block this one from landing in master
> for an imaginary plugin system.
>
> That said, I hope that minimal changes are required for modules under
> `src/` to become plugins later. Let’s get to that bridge before we cross
> it.
>
> That said, I am making plugins my priority in the next few weeks.
>
> Jan
> --
>
>
>

Re: Persona and BrowserID integration

Posted by Jan Lehnardt <ja...@apache.org>.
On Jul 29, 2013, at 18:29 , Jason Smith <jh...@apache.org> wrote:

> 
> On Mon, Jul 29, 2013 at 11:24 PM, Dirkjan Ochtman <di...@ochtman.nl> wrote:
>> On Mon, Jul 29, 2013 at 5:24 PM, Dale Harvey <da...@arandomurl.com> wrote:
>>> On the topic of browser_id support in CouchDB, it feels like this is a big
>>> chance to push for usable plugins, should the aim for this not to be
>>> included into core but to be available as a one click install from
>>> futon/fauxton (this and geocouch seem prime candidates)?
>> 
>> Yeah, I think that would be good. For me, the primary motivation would
>> be that CouchDB shouldn't grow a kitchen sink.

+1


>> On the other hand, one click installs from F(u|aux)ton sounds kind of ambitious!

Oh yes, and so worth it :)


> Given how old this plugin is (it came out right after BrowserID was
> announced IIRC), I kind of want to merge it in, then refactor it out
> if/when plugins improve.

I want plugins badly, but let’s not block this one from landing in master
for an imaginary plugin system.

That said, I hope that minimal changes are required for modules under
`src/` to become plugins later. Let’s get to that bridge before we cross it.

That said, I am making plugins my priority in the next few weeks.

Jan
-- 



Re: Persona and BrowserID integration

Posted by Jason Smith <jh...@apache.org>.
Given how old this plugin is (it came out right after BrowserID was
announced IIRC), I kind of want to merge it in, then refactor it out
if/when plugins improve.

On Mon, Jul 29, 2013 at 11:24 PM, Dirkjan Ochtman <di...@ochtman.nl> wrote:
> On Mon, Jul 29, 2013 at 5:24 PM, Dale Harvey <da...@arandomurl.com> wrote:
>> On the topic of browser_id support in CouchDB, it feels like this is a big
>> chance to push for usable plugins, should the aim for this not to be
>> included into core but to be available as a one click install from
>> futon/fauxton (this and geocouch seem prime candidates)?
>
> Yeah, I think that would be good. For me, the primary motivation would
> be that CouchDB shouldn't grow a kitchen sink.
>
> On the other hand, one click installs from F(u|aux)ton sounds kind of ambitious!
>
> Cheers,
>
> Dirkjan

Re: Persona and BrowserID integration

Posted by Dirkjan Ochtman <di...@ochtman.nl>.
On Mon, Jul 29, 2013 at 5:24 PM, Dale Harvey <da...@arandomurl.com> wrote:
> On the topic of browser_id support in CouchDB, it feels like this is a big
> chance to push for usable plugins, should the aim for this not to be
> included into core but to be available as a one click install from
> futon/fauxton (this and geocouch seem prime candidates)?

Yeah, I think that would be good. For me, the primary motivation would
be that CouchDB shouldn't grow a kitchen sink.

On the other hand, one click installs from F(u|aux)ton sounds kind of ambitious!

Cheers,

Dirkjan

Re: Persona and BrowserID integration

Posted by Jason Smith <jh...@apache.org>.
This is an interesting argument.

Dale, what do you think about the value of "official" Persona support
in CouchDB, versus the possibility that it becomes a plugin "killer
app" or at least a decent reference implementation?

The plugin has existed for a while; however it has gotten very little
use, in part because the whole concept of a plugin is ill-defined and
brittle. You need to set ERL_ZFLAGS to activate it, to say nothing of
compiling.

Also, note that I also plan to merge the OAuth plugin. Something I
could see being a plugin indefinitely is couchdb_pingquery, although
the state of the plugin system is still extremely anemic.

On Mon, Jul 29, 2013 at 10:24 PM, Dale Harvey <da...@arandomurl.com> wrote:
> On the topic of browser_id support in CouchDB, it feels like this is a big
> chance to push for usable plugins, should the aim for this not to be
> included into core but to be available as a one click install from
> futon/fauxton (this and geocouch seem prime candidates)?
>
> This isnt because I dont want browser_id support, I most definitely do, I
> recently wrote a node equivalent to Jasons browser_id plugin for the only
> reason that it would be easier for users to install / use on their local
> CouchDB instance.
>
> But we have a problem of support for anything 3rd party needing to be
> merged to core to be usable which is very much conflicting with peoples
> ability to get stuff done, the browser_id / geocouch and cors support have
> been around a long time but are mostly only available to the dedicated few
> (cors did eventually get merged), I would love to see a couchdb where the
> browser_id plugin was available to all users of couchdb the day you
> finished writing it, not (3?) years later
>
>
>
> On 29 July 2013 11:26, Jason Smith <jh...@nodejitsu.com> wrote:
>
>> Perfect, that is exactly what I will need. However, the first
>> milestone is rewrite my plugin in a branch, and hit the first
>> milestone.
>>
>> On Mon, Jul 29, 2013 at 5:19 PM, Dirkjan Ochtman <di...@ochtman.nl>
>> wrote:
>> > On Mon, Jul 29, 2013 at 12:02 PM, Jason Smith <jh...@nodejitsu.com> wrote:
>> >> To clarify, "tinfoil hat" mode is actually just a complete
>> >> implementation of the RP role, notably that it does not require the
>> >> POST to browserid.org/verify to verify an assertion. Thus, CouchDB
>> >> could be used on an intranet where an existing IdP exists. The IdP is
>> >> out of scope, but I expect to install one to test CouchDB when that
>> >> time comes.
>> >
>> > This might be useful inspiration: https://bitbucket.org/djc/persona-totp
>> .
>> >
>> > Cheers,
>> >
>> > Dirkjan
>>
>>
>>
>> --
>> Nodejitsu
>>

Re: Persona and BrowserID integration

Posted by Dale Harvey <da...@arandomurl.com>.
On the topic of browser_id support in CouchDB, it feels like this is a big
chance to push for usable plugins, should the aim for this not to be
included into core but to be available as a one click install from
futon/fauxton (this and geocouch seem prime candidates)?

This isnt because I dont want browser_id support, I most definitely do, I
recently wrote a node equivalent to Jasons browser_id plugin for the only
reason that it would be easier for users to install / use on their local
CouchDB instance.

But we have a problem of support for anything 3rd party needing to be
merged to core to be usable which is very much conflicting with peoples
ability to get stuff done, the browser_id / geocouch and cors support have
been around a long time but are mostly only available to the dedicated few
(cors did eventually get merged), I would love to see a couchdb where the
browser_id plugin was available to all users of couchdb the day you
finished writing it, not (3?) years later



On 29 July 2013 11:26, Jason Smith <jh...@nodejitsu.com> wrote:

> Perfect, that is exactly what I will need. However, the first
> milestone is rewrite my plugin in a branch, and hit the first
> milestone.
>
> On Mon, Jul 29, 2013 at 5:19 PM, Dirkjan Ochtman <di...@ochtman.nl>
> wrote:
> > On Mon, Jul 29, 2013 at 12:02 PM, Jason Smith <jh...@nodejitsu.com> wrote:
> >> To clarify, "tinfoil hat" mode is actually just a complete
> >> implementation of the RP role, notably that it does not require the
> >> POST to browserid.org/verify to verify an assertion. Thus, CouchDB
> >> could be used on an intranet where an existing IdP exists. The IdP is
> >> out of scope, but I expect to install one to test CouchDB when that
> >> time comes.
> >
> > This might be useful inspiration: https://bitbucket.org/djc/persona-totp
> .
> >
> > Cheers,
> >
> > Dirkjan
>
>
>
> --
> Nodejitsu
>

Re: Persona and BrowserID integration

Posted by Jason Smith <jh...@nodejitsu.com>.
Perfect, that is exactly what I will need. However, the first
milestone is rewrite my plugin in a branch, and hit the first
milestone.

On Mon, Jul 29, 2013 at 5:19 PM, Dirkjan Ochtman <di...@ochtman.nl> wrote:
> On Mon, Jul 29, 2013 at 12:02 PM, Jason Smith <jh...@nodejitsu.com> wrote:
>> To clarify, "tinfoil hat" mode is actually just a complete
>> implementation of the RP role, notably that it does not require the
>> POST to browserid.org/verify to verify an assertion. Thus, CouchDB
>> could be used on an intranet where an existing IdP exists. The IdP is
>> out of scope, but I expect to install one to test CouchDB when that
>> time comes.
>
> This might be useful inspiration: https://bitbucket.org/djc/persona-totp.
>
> Cheers,
>
> Dirkjan



-- 
Nodejitsu

Re: Persona and BrowserID integration

Posted by Dirkjan Ochtman <di...@ochtman.nl>.
On Mon, Jul 29, 2013 at 12:02 PM, Jason Smith <jh...@nodejitsu.com> wrote:
> To clarify, "tinfoil hat" mode is actually just a complete
> implementation of the RP role, notably that it does not require the
> POST to browserid.org/verify to verify an assertion. Thus, CouchDB
> could be used on an intranet where an existing IdP exists. The IdP is
> out of scope, but I expect to install one to test CouchDB when that
> time comes.

This might be useful inspiration: https://bitbucket.org/djc/persona-totp.

Cheers,

Dirkjan

Re: Persona and BrowserID integration

Posted by Jason Smith <jh...@nodejitsu.com>.
Thanks Dirkjan (and Jan).

Yes, so the first milestone is definitely a standard RP mode working
against browserid.org's web services.

To clarify, "tinfoil hat" mode is actually just a complete
implementation of the RP role, notably that it does not require the
POST to browserid.org/verify to verify an assertion. Thus, CouchDB
could be used on an intranet where an existing IdP exists. The IdP is
out of scope, but I expect to install one to test CouchDB when that
time comes.

Tinfoil hat mode is perfectly cromulent, I just called it that due to
recent news about wiretaps and that stuff.

On Mon, Jul 29, 2013 at 4:03 PM, Dirkjan Ochtman <di...@ochtman.nl> wrote:
> On Mon, Jul 29, 2013 at 6:13 AM, Jason Smith <ja...@gmail.com> wrote:
>> Thanks, Jim. That is basically my plan. To be clear, I would ship
>> "outsourced mode" (browserid.org hosted JavaScript and verification)
>> in a CouchDB release. It's just that I would work to get "tinfoil hat
>> mode" added in for a subsequent release. Outsourced mode already
>> exists (modulo a rewrite and unit tests) as a plugin, but I want to
>> merge it in.
>
> Running the verification inside CouchDB is very sane. It looks like
> local verification will be the recommended approach anyway in the near
> future.
>
>> I am not sure if I understand you exactly. Persona is a three-party
>> protocol between users, relying parties (RPs) and identity providers
>> (IdPs). I am talking about RP support for CouchDB. AFAIK there is a
>> bit of mere-mortal cypto to do but it does not require IdP support.
>
> Your tinfoil hat mode is a bit weird. If you're doing disconnected
> operation, you can only connect to Identity Providers inside the LAN,
> so general RP support becomes impossible, so it's a pretty crippled
> setup.
>
> Cheers,
>
> Dirkjan


-- 
Nodejitsu

Re: Persona and BrowserID integration

Posted by Dirkjan Ochtman <di...@ochtman.nl>.
On Mon, Jul 29, 2013 at 6:13 AM, Jason Smith <ja...@gmail.com> wrote:
> Thanks, Jim. That is basically my plan. To be clear, I would ship
> "outsourced mode" (browserid.org hosted JavaScript and verification)
> in a CouchDB release. It's just that I would work to get "tinfoil hat
> mode" added in for a subsequent release. Outsourced mode already
> exists (modulo a rewrite and unit tests) as a plugin, but I want to
> merge it in.

Running the verification inside CouchDB is very sane. It looks like
local verification will be the recommended approach anyway in the near
future.

> I am not sure if I understand you exactly. Persona is a three-party
> protocol between users, relying parties (RPs) and identity providers
> (IdPs). I am talking about RP support for CouchDB. AFAIK there is a
> bit of mere-mortal cypto to do but it does not require IdP support.

Your tinfoil hat mode is a bit weird. If you're doing disconnected
operation, you can only connect to Identity Providers inside the LAN,
so general RP support becomes impossible, so it's a pretty crippled
setup.

Cheers,

Dirkjan

Re: Persona and BrowserID integration

Posted by Dirkjan Ochtman <di...@ochtman.nl>.
On Mon, Jul 29, 2013 at 5:26 PM, Jim Klo <ji...@sri.com> wrote:
> Right.  The key difference from other 3-party solutions is that, once the BrowserID protocol is up and running with a really stable release, Identity verification should be untraceable by the IdP. BrowserID uses a model where the client generates public key material and asks their IdP to validate and countersign an assertion and hand back to them a signed response.  The client then hands that signed response over the the RP from which the only thing the RP should have to do is validate the countersigning done by the IdP using the IdP's well known public certificate.

Identity verification should be untraceable by the IdP in the current
setup as well.

> The challenge really is while they have their spec stored in GitHub… the protocol itself isn't well versioned IMO in that it doesn't advertise the running version and there's no way to interoperate with a specific version of the protocol AFAIK. Thus keeping RP implementations in sync with production is a royal PITA - resulting in versions of the current CouchDB plugin breaking all of a sudden because Mozilla changed something and theres no way to request the old version of the protocol hence validation done on the RP side breaks..

Protocol versioning is one of the remaining goals, it will be done.
But you're still pretty vague here about versioning and how things
break. AFAICT, the actual recommended RP API has changed a few times,
but the old versions are still supported, so nothing is broken on that
side. What might have been broken is the shim implementation of the
DOM/UA handling of RP/IdP intermediary, but that Mozilla has AFAIK
always said that that part has not been stabilized, and this is the
reason you shouldn't fork your own include.js.

> I was just +1 that if someone wanted to build IdP support for Persona/BrowserID into CouchDB - for those of us who would like a more stable provider that doesn't up and change suddenly breaking things.

This doesn't make sense. The IdP API has been perfectly stable for a
long while now. And I'm not sure CouchDB *as* an IdP makes a whole lot
of sense, though of course an IdP could trivially be backed by
CouchDB.

> Also +1 for better RP support when Persona is 'ready'.

I'd contend that free-standing RP support doesn't mean it's better,
it's just free-standing. But the assumption that disconnected
operation isn't very important to almost all users seems sensible
enough to me.

Cheers,

Dirkjan

Re: Persona and BrowserID integration

Posted by Jim Klo <ji...@sri.com>.
On Jul 28, 2013, at 9:13 PM, Jason Smith <ja...@gmail.com>
 wrote:

> Thanks, Jim. That is basically my plan. To be clear, I would ship
> "outsourced mode" (browserid.org hosted JavaScript and verification)
> in a CouchDB release. It's just that I would work to get "tinfoil hat
> mode" added in for a subsequent release. Outsourced mode already
> exists (modulo a rewrite and unit tests) as a plugin, but I want to
> merge it in.
> 
> I am not sure if I understand you exactly. Persona is a three-party
> protocol between users, relying parties (RPs) and identity providers
> (IdPs). I am talking about RP support for CouchDB. AFAIK there is a
> bit of mere-mortal cypto to do but it does not require IdP support.
> 


Right.  The key difference from other 3-party solutions is that, once the BrowserID protocol is up and running with a really stable release, Identity verification should be untraceable by the IdP. BrowserID uses a model where the client generates public key material and asks their IdP to validate and countersign an assertion and hand back to them a signed response.  The client then hands that signed response over the the RP from which the only thing the RP should have to do is validate the countersigning done by the IdP using the IdP's well known public certificate. 

The challenge really is while they have their spec stored in GitHub… the protocol itself isn't well versioned IMO in that it doesn't advertise the running version and there's no way to interoperate with a specific version of the protocol AFAIK. Thus keeping RP implementations in sync with production is a royal PITA - resulting in versions of the current CouchDB plugin breaking all of a sudden because Mozilla changed something and theres no way to request the old version of the protocol hence validation done on the RP side breaks..

I was just +1 that if someone wanted to build IdP support for Persona/BrowserID into CouchDB - for those of us who would like a more stable provider that doesn't up and change suddenly breaking things.  Also +1 for better RP support when Persona is 'ready'.

- JK

> On Mon, Jul 29, 2013 at 11:00 AM, Jim Klo <ji...@sri.com> wrote:
>> I've been in touch with the Mozilla folks off and on over this.  I've not checked with them recently on this but at least for the time being, unless your plan is to turn CouchDB into a full IDP and perform the JOSE/JWT verification that the client generates, you should not host the bits for BrowserID / Persona inside CouchDB. If the plan is to continue to use Mozilla as the IDP, where CouchDB is just an RP - you should just link to or cache from Mozilla.
>> 
>> +1 if someone wants to build a plugin that implements the full BrowserID protocol inside CouchDB.
>> 
>> Jim Klo
>> Senior Software Engineer
>> SRI International
>> p: 805.542.9330 x121
>> t: @nsomnac
>> 
>> On Jul 28, 2013, at 8:30 PM, "Jason Smith" <jh...@apache.org>> wrote:
>> 
>> My guess is "preferred" will depend on the usage type. Frankly IMO to
>> a first approximation, nobody uses disconnected operation anymore. (At
>> least, if they do, they have the resources to fork CouchDB.)
>> 
>> In practice, hosting a copy of include.js has been problematic. Logins
>> break every month or two. "Outsourced" mode will be more useful, for
>> sure.
>> 
>> However I think CouchDB has a moral duty to support disconnected
>> operation. So that is why both modes are in my plan.
>> 
>> On Mon, Jul 29, 2013 at 10:12 AM, Alexander Shorin <kx...@gmail.com>> wrote:
>> Hi Jason,
>> 
>> I think having "all in house" solution is preferred since it will
>> allow private local area networks to use such auth for CouchDB without
>> need to access some remote resources. With browserid / persona it will
>> be possible to have CouchDB as auth server for other instances, right?
>> --
>> ,,,^..^,,,
>> 
>> 
>> On Mon, Jul 29, 2013 at 6:42 AM, Jason Smith <jh...@apache.org>> wrote:
>> (Breaking off from the "IRC meeting" thread.)
>> 
>> Credit where it's due: The initial push for Persona in CouchDB came
>> from Randall Leeds.
>> 
>> Dirkjan says to use the hosted include.js file instead of serving it
>> internally. I kind of agree, but note that CouchDB hosts its own
>> JQuery. The priority is not that we match the latest spec, the
>> priority is that people can log in.
>> 
>> CouchDB should support disconnected operation. Where possible, we
>> should be able to authenticate without depending on a third-party over
>> the Internet. However I would like to achieve that by various
>> milestones of partial completion.
>> 
>> There are two (known) areas where my implementation relies on third parties.
>> 
>> 1. The include.js file
>> 2. Validating the client signature over browserid.org/verify<http://browserid.org/verify>
>> 
>> At this time, for #1 we host our own copy, and for #2 we outsource to
>> the browserid.org<http://browserid.org> web service, so that is inconsistent. I am thinking
>> of the following milestones:
>> 
>> 1. Everything outsourced.
>> * Link to browserid.org<http://browserid.org> for include.js
>> * Call out to browserid.org<http://browserid.org> for signature validation
>> 2. Erlang implementation of signature validation. This will take some
>> R&D, could be a nice newbie project
>> 3. Once Couch can do all the crypto "in-house," provide an option to
>> use either the self-contained implementation or else the
>> Internet-ready implementation. Most Persona logins will be to an
>> Internet server with a gmail.com<http://gmail.com> address.
>> 
>> My definition of success:
>> 
>> 1. Install CouchDB on a LAN
>> 2. Install a free software identity provider (IdP)
>> 3. Disconnect the LAN
>> 4. Create email accounts
>> 5. Authenticate to CouchDB over BrowserID


Re: Persona and BrowserID integration

Posted by Jason Smith <ja...@gmail.com>.
Thanks, Jim. That is basically my plan. To be clear, I would ship
"outsourced mode" (browserid.org hosted JavaScript and verification)
in a CouchDB release. It's just that I would work to get "tinfoil hat
mode" added in for a subsequent release. Outsourced mode already
exists (modulo a rewrite and unit tests) as a plugin, but I want to
merge it in.

I am not sure if I understand you exactly. Persona is a three-party
protocol between users, relying parties (RPs) and identity providers
(IdPs). I am talking about RP support for CouchDB. AFAIK there is a
bit of mere-mortal cypto to do but it does not require IdP support.

On Mon, Jul 29, 2013 at 11:00 AM, Jim Klo <ji...@sri.com> wrote:
> I've been in touch with the Mozilla folks off and on over this.  I've not checked with them recently on this but at least for the time being, unless your plan is to turn CouchDB into a full IDP and perform the JOSE/JWT verification that the client generates, you should not host the bits for BrowserID / Persona inside CouchDB. If the plan is to continue to use Mozilla as the IDP, where CouchDB is just an RP - you should just link to or cache from Mozilla.
>
> +1 if someone wants to build a plugin that implements the full BrowserID protocol inside CouchDB.
>
> Jim Klo
> Senior Software Engineer
> SRI International
> p: 805.542.9330 x121
> t: @nsomnac
>
> On Jul 28, 2013, at 8:30 PM, "Jason Smith" <jh...@apache.org>> wrote:
>
> My guess is "preferred" will depend on the usage type. Frankly IMO to
> a first approximation, nobody uses disconnected operation anymore. (At
> least, if they do, they have the resources to fork CouchDB.)
>
> In practice, hosting a copy of include.js has been problematic. Logins
> break every month or two. "Outsourced" mode will be more useful, for
> sure.
>
> However I think CouchDB has a moral duty to support disconnected
> operation. So that is why both modes are in my plan.
>
> On Mon, Jul 29, 2013 at 10:12 AM, Alexander Shorin <kx...@gmail.com>> wrote:
> Hi Jason,
>
> I think having "all in house" solution is preferred since it will
> allow private local area networks to use such auth for CouchDB without
> need to access some remote resources. With browserid / persona it will
> be possible to have CouchDB as auth server for other instances, right?
> --
> ,,,^..^,,,
>
>
> On Mon, Jul 29, 2013 at 6:42 AM, Jason Smith <jh...@apache.org>> wrote:
> (Breaking off from the "IRC meeting" thread.)
>
> Credit where it's due: The initial push for Persona in CouchDB came
> from Randall Leeds.
>
> Dirkjan says to use the hosted include.js file instead of serving it
> internally. I kind of agree, but note that CouchDB hosts its own
> JQuery. The priority is not that we match the latest spec, the
> priority is that people can log in.
>
> CouchDB should support disconnected operation. Where possible, we
> should be able to authenticate without depending on a third-party over
> the Internet. However I would like to achieve that by various
> milestones of partial completion.
>
> There are two (known) areas where my implementation relies on third parties.
>
> 1. The include.js file
> 2. Validating the client signature over browserid.org/verify<http://browserid.org/verify>
>
> At this time, for #1 we host our own copy, and for #2 we outsource to
> the browserid.org<http://browserid.org> web service, so that is inconsistent. I am thinking
> of the following milestones:
>
> 1. Everything outsourced.
>  * Link to browserid.org<http://browserid.org> for include.js
>  * Call out to browserid.org<http://browserid.org> for signature validation
> 2. Erlang implementation of signature validation. This will take some
> R&D, could be a nice newbie project
> 3. Once Couch can do all the crypto "in-house," provide an option to
> use either the self-contained implementation or else the
> Internet-ready implementation. Most Persona logins will be to an
> Internet server with a gmail.com<http://gmail.com> address.
>
> My definition of success:
>
> 1. Install CouchDB on a LAN
> 2. Install a free software identity provider (IdP)
> 3. Disconnect the LAN
> 4. Create email accounts
> 5. Authenticate to CouchDB over BrowserID

Re: Persona and BrowserID integration

Posted by Jim Klo <ji...@sri.com>.
I've been in touch with the Mozilla folks off and on over this.  I've not checked with them recently on this but at least for the time being, unless your plan is to turn CouchDB into a full IDP and perform the JOSE/JWT verification that the client generates, you should not host the bits for BrowserID / Persona inside CouchDB. If the plan is to continue to use Mozilla as the IDP, where CouchDB is just an RP - you should just link to or cache from Mozilla.

+1 if someone wants to build a plugin that implements the full BrowserID protocol inside CouchDB.

Jim Klo
Senior Software Engineer
SRI International
p: 805.542.9330 x121
t: @nsomnac

On Jul 28, 2013, at 8:30 PM, "Jason Smith" <jh...@apache.org>> wrote:

My guess is "preferred" will depend on the usage type. Frankly IMO to
a first approximation, nobody uses disconnected operation anymore. (At
least, if they do, they have the resources to fork CouchDB.)

In practice, hosting a copy of include.js has been problematic. Logins
break every month or two. "Outsourced" mode will be more useful, for
sure.

However I think CouchDB has a moral duty to support disconnected
operation. So that is why both modes are in my plan.

On Mon, Jul 29, 2013 at 10:12 AM, Alexander Shorin <kx...@gmail.com>> wrote:
Hi Jason,

I think having "all in house" solution is preferred since it will
allow private local area networks to use such auth for CouchDB without
need to access some remote resources. With browserid / persona it will
be possible to have CouchDB as auth server for other instances, right?
--
,,,^..^,,,


On Mon, Jul 29, 2013 at 6:42 AM, Jason Smith <jh...@apache.org>> wrote:
(Breaking off from the "IRC meeting" thread.)

Credit where it's due: The initial push for Persona in CouchDB came
from Randall Leeds.

Dirkjan says to use the hosted include.js file instead of serving it
internally. I kind of agree, but note that CouchDB hosts its own
JQuery. The priority is not that we match the latest spec, the
priority is that people can log in.

CouchDB should support disconnected operation. Where possible, we
should be able to authenticate without depending on a third-party over
the Internet. However I would like to achieve that by various
milestones of partial completion.

There are two (known) areas where my implementation relies on third parties.

1. The include.js file
2. Validating the client signature over browserid.org/verify<http://browserid.org/verify>

At this time, for #1 we host our own copy, and for #2 we outsource to
the browserid.org<http://browserid.org> web service, so that is inconsistent. I am thinking
of the following milestones:

1. Everything outsourced.
 * Link to browserid.org<http://browserid.org> for include.js
 * Call out to browserid.org<http://browserid.org> for signature validation
2. Erlang implementation of signature validation. This will take some
R&D, could be a nice newbie project
3. Once Couch can do all the crypto "in-house," provide an option to
use either the self-contained implementation or else the
Internet-ready implementation. Most Persona logins will be to an
Internet server with a gmail.com<http://gmail.com> address.

My definition of success:

1. Install CouchDB on a LAN
2. Install a free software identity provider (IdP)
3. Disconnect the LAN
4. Create email accounts
5. Authenticate to CouchDB over BrowserID

Re: Persona and BrowserID integration

Posted by Jason Smith <jh...@apache.org>.
My guess is "preferred" will depend on the usage type. Frankly IMO to
a first approximation, nobody uses disconnected operation anymore. (At
least, if they do, they have the resources to fork CouchDB.)

In practice, hosting a copy of include.js has been problematic. Logins
break every month or two. "Outsourced" mode will be more useful, for
sure.

However I think CouchDB has a moral duty to support disconnected
operation. So that is why both modes are in my plan.

On Mon, Jul 29, 2013 at 10:12 AM, Alexander Shorin <kx...@gmail.com> wrote:
> Hi Jason,
>
> I think having "all in house" solution is preferred since it will
> allow private local area networks to use such auth for CouchDB without
> need to access some remote resources. With browserid / persona it will
> be possible to have CouchDB as auth server for other instances, right?
> --
> ,,,^..^,,,
>
>
> On Mon, Jul 29, 2013 at 6:42 AM, Jason Smith <jh...@apache.org> wrote:
>> (Breaking off from the "IRC meeting" thread.)
>>
>> Credit where it's due: The initial push for Persona in CouchDB came
>> from Randall Leeds.
>>
>> Dirkjan says to use the hosted include.js file instead of serving it
>> internally. I kind of agree, but note that CouchDB hosts its own
>> JQuery. The priority is not that we match the latest spec, the
>> priority is that people can log in.
>>
>> CouchDB should support disconnected operation. Where possible, we
>> should be able to authenticate without depending on a third-party over
>> the Internet. However I would like to achieve that by various
>> milestones of partial completion.
>>
>> There are two (known) areas where my implementation relies on third parties.
>>
>> 1. The include.js file
>> 2. Validating the client signature over browserid.org/verify
>>
>> At this time, for #1 we host our own copy, and for #2 we outsource to
>> the browserid.org web service, so that is inconsistent. I am thinking
>> of the following milestones:
>>
>> 1. Everything outsourced.
>>   * Link to browserid.org for include.js
>>   * Call out to browserid.org for signature validation
>> 2. Erlang implementation of signature validation. This will take some
>> R&D, could be a nice newbie project
>> 3. Once Couch can do all the crypto "in-house," provide an option to
>> use either the self-contained implementation or else the
>> Internet-ready implementation. Most Persona logins will be to an
>> Internet server with a gmail.com address.
>>
>> My definition of success:
>>
>> 1. Install CouchDB on a LAN
>> 2. Install a free software identity provider (IdP)
>> 3. Disconnect the LAN
>> 4. Create email accounts
>> 5. Authenticate to CouchDB over BrowserID

Re: Persona and BrowserID integration

Posted by Alexander Shorin <kx...@gmail.com>.
Hi Jason,

I think having "all in house" solution is preferred since it will
allow private local area networks to use such auth for CouchDB without
need to access some remote resources. With browserid / persona it will
be possible to have CouchDB as auth server for other instances, right?
--
,,,^..^,,,


On Mon, Jul 29, 2013 at 6:42 AM, Jason Smith <jh...@apache.org> wrote:
> (Breaking off from the "IRC meeting" thread.)
>
> Credit where it's due: The initial push for Persona in CouchDB came
> from Randall Leeds.
>
> Dirkjan says to use the hosted include.js file instead of serving it
> internally. I kind of agree, but note that CouchDB hosts its own
> JQuery. The priority is not that we match the latest spec, the
> priority is that people can log in.
>
> CouchDB should support disconnected operation. Where possible, we
> should be able to authenticate without depending on a third-party over
> the Internet. However I would like to achieve that by various
> milestones of partial completion.
>
> There are two (known) areas where my implementation relies on third parties.
>
> 1. The include.js file
> 2. Validating the client signature over browserid.org/verify
>
> At this time, for #1 we host our own copy, and for #2 we outsource to
> the browserid.org web service, so that is inconsistent. I am thinking
> of the following milestones:
>
> 1. Everything outsourced.
>   * Link to browserid.org for include.js
>   * Call out to browserid.org for signature validation
> 2. Erlang implementation of signature validation. This will take some
> R&D, could be a nice newbie project
> 3. Once Couch can do all the crypto "in-house," provide an option to
> use either the self-contained implementation or else the
> Internet-ready implementation. Most Persona logins will be to an
> Internet server with a gmail.com address.
>
> My definition of success:
>
> 1. Install CouchDB on a LAN
> 2. Install a free software identity provider (IdP)
> 3. Disconnect the LAN
> 4. Create email accounts
> 5. Authenticate to CouchDB over BrowserID

Re: Persona and BrowserID integration

Posted by Francois Marier <fr...@mozilla.com>.
On 29/07/13 14:42, Jason Smith wrote:
> CouchDB should support disconnected operation. Where possible, we
> should be able to authenticate without depending on a third-party over
> the Internet. However I would like to achieve that by various
> milestones of partial completion.

Removing the dependency on a central third-party (Mozilla in this case)
is a great goal and it is in fact one of the goals of the Persona team
at Mozilla. We'll know that we are done with Persona when we can forget
to renew the persona.org domain and nobody complains ;)

However that is different from saying that logins should work when the
system is completely disconnected from the Internet. If you want to work
in a disconnected way, then you need to do everything yourself. You need
to force users to use your IdP, then host all of the login code
yourself. This could work within an organization's internal network, but
I don't think it should be the focus of the implementation because
that's not the common case.

The most common case would be a site that allows various users (who
should be free to choose who their identity provider is) to log into
your site. In this case, you need to be able to talk to their IdP to
check the validity of their cert.

> There are two (known) areas where my implementation relies on third parties.
> 
> 1. The include.js file
> 2. Validating the client signature over browserid.org/verify

The purpose of include.js is to check whether or not the browser has
native Persona support and if not, to setup a communication channel with
the JavaScript shim.

The JavaScript shim is hosted on Persona.org and cannot be self-hosted
because we rely on localStorage domain restrictions to keep the local
keys secure. The path towards decentralized here is for browsers to get
native support and not require the shim at all.

So a fully decentralized use case (not yet possible) looks like this:

(a) the relying party self-hosting include.js
(b) the user's browser has native Persona support
(c) the user's email is backed by a Persona IdP
(d) the relying party does its own verification of assertions

Once we have all 4 of these then there is no longer any traffic going
towards persona.org.

> 1. Everything outsourced.
>   * Link to browserid.org for include.js
>   * Call out to browserid.org for signature validation

That's also what I would recommend right now.

> 2. Erlang implementation of signature validation. This will take some
> R&D, could be a nice newbie project

What I would love to see (anybody interested should feel free to email
me) is an Erlang library to do this verification, separate from CouchDB,
so that other Erlang projects could use it.

It could start by just POSTing assertions to verifier.login.persona.org
and then later on be "upgraded" to doing its own local verification
(without changing the API). This means that anybody using it wouldn't
have to change anything in their code and would be upgraded to a more
decentralized flow automatically.

We have written a node.js library that does exactly that:

  https://github.com/chilts/browserid-verify-node

and we'll be extending it to the other languages we know.

Francois