Hey there,
I noticed quite a few people having trouble setting up the initial authentication with custom auth, so I thought: why not expand on the idea of the extra handler/hook in sync_gateway, as described here:
But provide integrated support for JWT out of the box? There are JTW libraries for go, so I believe code changes would be minimal. I still have to learn go though. Maybe some more experienced developers could take a look at this?
I've explained the situation in more detail here (text is extensive > skip to implementation number 3 - Own Authenticated Server + JWT):
Either if its implemented or not, in that article I try to clarify such questions (sessions, tokens, etc). Hope it helps somebody, feedback is welcome.
If it does get implemented, I think its a double-win: users get the authentication issue solved for both replication AND standard REST calls, also in a simpler way.
BR/Thiago