SaltechSystems / couchbase_lite

Flutter plugin for the Community edition of Couchbase Lite. Couchbase Lite is an embedded lightweight, document-oriented (NoSQL), syncable database engine.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Supported authentication mechanisms

mehrdad-shokri opened this issue · comments

There are several authentication methods supported by sync gateway. What mechanisms does this library support? I'm looking specifically for OpenID connect authentications

Refer to https://docs.couchbase.com/sync-gateway/current/authentication.html on how to do this. This library supports Auth through sessions as well as basic Auth as does the other couchbase lite libraries.

@bawelter does it support OpenID connect? Since it's available on Sync gateway

Specifically, I'm looking for cookie authentication in remote replication. I handle session retrieval myself.

To clarify things, I wanna setup KeyCloack for OpenID connect provider, I'm not sure how to connect this lib to sync gateway through OpenID connect. The doc says that it supports OpenID protocol. But I'm not sure whether I should retrieve session myself and attach to this lib as a cookie or can it be delegated to the lib completely.

Sync Gateway and Couchbase Lite (and consequently this library) support implicit flow only. You'll have to interact with your Open ID provider in order to retrieve an access token, and configure Sync Gateway to be able to verify that token. You can refer to this article in the documentation https://docs.couchbase.com/sync-gateway/current/authentication.html#openid-connect

Couchbase documentation regarding this subject is honestly not really good. There are alot of gotchas until you figure out the pieces. I wish there is a step-by-step instruction on how to configure sync_gateway to accept google oauth2 and dynamically create an user. It took me the whole day but I am glad now that it works.

Feel free to provide the documentation through a pull request / README documentation.

This company is not affiliated with Couchbase.