I'm setting up sync-gateway with Auth0.
My config is:
{
"interface":":4984",
"log": ["*"],
"databases": {
"graps": {
"username": "sync_gateway",
"password": "sync_gateway",
"num_index_replicas": 0,
"server": "http://couchbase_server:8091",
"bucket": "test_bucket",
"enable_shared_bucket_access": true,
"import_docs": "continuous",
"oidc": {
"providers": {
"Auth0": {
"issuer": "https://my_tenant.eu.auth0.com",
"client_id": "secret_client_id",
"validation_key": "long_validation_key",
"register": true
}
}
},
"import_filter":
function(doc) {
if (doc.type != "mobile") {
return false
}
return true
}
,
"sync": function (doc, oldDoc) {
if (doc.sdk) {
channel(doc.sdk);
}
}
}
}
}
My curl request:
curl -vX POST -H 'Content-Type: application/json' http://sync_geteway_server:4984/graps/_session --header 'Authorization: Bearer AUTH0_JWT_TOKEN' -d '{"name": "test","ttl":0}'
And sync logs:
2018-12-24T13:05:12.727Z [INF] HTTP: #001: POST /graps/_session
2018-12-24T13:05:12.727Z [INF] HTTP: #001: --> 401 Invalid login (0.4 ms)
So, my question: what's wrong? Why sync does not perceive JWT token as oauth session?