Authorization in CB server and sync gateway

Hi Team,

Also, Can you give me some idea about like how to authorize users in web and mobile both? Like on the web I am using nodeJS and JWT for maintaining sessions and in mobile, we have the sync gateway for maintaining it. So I am getting a little confused about it.

TIA

From your previous post, I take it that you are using REST API in 1.4 version of Couchbase Lite . This is important because the options vary in 2.0 and if you are using native API.

I would suggest looking at the Implicit OIDC flow . Documentation available here. Basically, the client can fetch the token and send it as Bearer Token in Authorization header of HTTP request

Okay But in web app, I am generating token through jwt token library. So Do I need to use this link.

Yes, that token is then used to authenticate you in Couchbase Sync Gateway.

Okay, So if the user registers to the app and perform some data operations on the server and then deletes the app which deletes all the data from it. So if he again installs the app then if I want to use installPrebuiltDb() function of couchbase db. So How can I achieve that but data should only be related to the user?