We have tried some with Postman, with the same result… Here are the SGW config file, log, and a crude snippet of our client code.
Config:
{
“interface”:":4984",
“adminInterface”: “127.0.0.1:4985”,
“log”: [""],
“CORS”: {
“Origin”:[""],
“LoginOrigin”:["*"],
“Headers”:[“Content-Type”],
“MaxAge”: 1728000
},
“databases”:{
“mydatabase”:{
“server”:"<server_host>",
“bucket”:"<bucket_name<",
“username”:"",
“password”:"",
“enable_shared_bucket_access”: true,
“continuous”:true,
“import_docs”: “continuous”,
“sync”:function(doc) { channel(doc.channels); }
,
“oidc”: {
“providers”: {
"": {
“issuer”:"",
“client_id”:"<client_id>",
“validation_key”:"",
“register”:true
}
}
},
“users”: {
“GUEST”: {
“disabled”:true
}
}
}
}
}
SGW Log
2018-02-05T15:22:48.996Z OIDC+: AuthenticateJWT called with token: eyJhbGciOiJSUzI1NiIsImtpZCI6IjYwNzgzNm…kNzQ2IiwiCbcA_xWgXThtP837aR-Gxw
2018-02-05T15:22:48.996Z OIDC+: JWT issuer: , audiences: [xxx]
2018-02-05T15:22:48.996Z OIDC+: Call GetProviderForIssuer w/ providers: map[xxxx:0xc4201d00c0]
2018-02-05T15:22:48.996Z OIDC+: GetProviderForIssuer with issuer: , audiences: [xxx]
2018-02-05T15:22:48.996Z OIDC+: Provider matches, returning
2018-02-05T15:22:48.996Z OIDC+: Provider for issuer: &{JWTOptions:{ValidationKey: SigningMethod:} Issuer: Register:true ClientID:0xc42000f460 ValidationKey:0xc42000f480 CallbackURL: DisableSession:false Scope:[openid email profile] IncludeAccessToken:false UserPrefix: DiscoveryURI: DisableConfigValidation:false OIDCClient: OIDCClientOnce:{m:{state:0 sema:0} done:0} IsDefault:true Name:xxxx}
2018-02-05T15:22:49.007Z OIDC: Not synchronizing provider config for issuer …
2018-02-05T15:22:49.025Z OIDC+: JWT identity: &{ID:6fb24dd3-d5c5-4124-84d1-f2c52e1bab36 Name: Email: ExpiresAt:2018-02-05 15:27:43 +0000 UTC}
2018-02-05T15:22:49.025Z OIDC+: OIDCUsername: xxxx.azurewebsites.net_ab123-defgc5-4124-wd34-54jfgrbrtsSf
2018-02-05T15:22:49.026Z HTTP: #001: POST /xxxx/_session (as xxxx.azurewebsites.net_ab123-defgc5-4124-wd34-54jfgrbrtsSf)
2018-02-05T15:22:49.026Z WARNING: Couldn’t parse JSON in HTTP request: EOF – db.ReadJSONFromMIME() at attachment.go:224
2018-02-05T15:22:49.026Z HTTP+: #001: --> 200 (30.3 ms)
2018-02-05T15:22:51.704Z HTTP: #002: GET /xxxx/_changes?feed=websocket (as xxxx.azurewebsites.net_ab123-defgc5-4124-wd34-54jfgrbrtsSf)
2018-02-05T15:22:51.704Z HTTP+: #002: --> 101 Upgraded to WebSocket protocol (0.0 ms)
2018-02-05T15:22:51.816Z Changes+: Int sequence multi changes feed…
2018-02-05T15:22:51.816Z Changes: MultiChangesFeed(channels: {}, options: {Since:0 Limit:0 Conflicts:true IncludeDocs:false Wait:true Continuous:true Terminator:0xc4203f0d20 HeartbeatMs:300000 TimeoutMs:300000 ActiveOnly:true}) … (to xxxx.azurewebsites.net_ab123-defgc5-4124-wd34-54jfgrbrtsSf)
2018-02-05T15:22:51.817Z Changes+: MultiChangesFeed: channels expand to “!:1” … (to xxxx.azurewebsites.net_ab123-defgc5-4124-wd34-54jfgrbrtsSf)
2018-02-05T15:22:51.817Z Cache: Initialized cache for channel “!” with options: &{ChannelCacheMinLength:50 ChannelCacheMaxLength:500 ChannelCacheAge:1m0s}
2018-02-05T15:22:51.817Z Cache: getCachedChanges("!", 0) --> 0 changes valid from #36
2018-02-05T15:22:51.817Z Cache: Querying ‘channels’ view for “!” (start=#1, end=#36, limit=0)
2018-02-05T15:22:51.884Z Cache: Got no rows from view for “!“
2018-02-05T15:22:51.884Z Cache: GetChangesInChannel(”!”) --> 0 rows
2018-02-05T15:22:51.884Z Changes+: [changesFeed] Found 0 changes for channel !
2018-02-05T15:22:51.884Z Changes+: MultiChangesFeed waiting… (to xxxx.azurewebsites.net_ab123-defgc5-4124-wd34-54jfgrbrtsSf)
2018-02-05T15:22:51.884Z Changes+: No new changes to send to change listener. Waiting for “xxxx”'s count to pass 5
2018-02-05T15:22:57.143Z HTTP: #003: GET /xxxx/_changes?feed=websocket (as xxxx.azurewebsites.net_ab123-defgc5-4124-wd34-54jfgrbrtsSf)
2018-02-05T15:22:57.143Z HTTP+: #003: --> 101 Upgraded to WebSocket protocol (0.0 ms)
2018-02-05T15:22:57.212Z Changes+: Int sequence multi changes feed…
2018-02-05T15:22:57.213Z Changes: MultiChangesFeed(channels: {}, options: {Since:0 Limit:0 Conflicts:true IncludeDocs:false Wait:true Continuous:true Terminator:0xc420374fc0 HeartbeatMs:300000 TimeoutMs:300000 ActiveOnly:false}) … (to xxxx.azurewebsites.net_ab123-defgc5-4124-wd34-54jfgrbrtsSf)
2018-02-05T15:22:57.213Z Changes+: MultiChangesFeed: channels expand to “!:1” … (to xxxx.azurewebsites.net_ab123-defgc5-4124-wd34-54jfgrbrtsSf)
2018-02-05T15:22:57.213Z Cache: getCachedChanges("!", 0) --> 0 changes valid from #1
2018-02-05T15:22:57.213Z Changes+: [changesFeed] Found 0 changes for channel !
2018-02-05T15:22:57.213Z Changes+: MultiChangesFeed waiting… (to xxxx.azurewebsites.net_ab123-defgc5-4124-wd34-54jfgrbrtsSf)
2018-02-05T15:22:57.213Z Changes+: No new changes to send to change listener. Waiting for “xxxx”'s count to pass 5
Client code snippet
…
PullReplication = _database.CreatePullReplication(_sgUri);
PullReplication.SetCookie(“SyncGatewaySession”, session.Id, session.Path, session.ExpiresAt, false, false);
PullReplication.Continuous = true;
PullReplication.Changed += OnChanged;
PushReplication = _database.CreatePushReplication(_sgUri);
PushReplication.SetCookie("SyncGatewaySession", session.Id, session.Path, session.ExpiresAt, false, false);
PushReplication.Continuous = true;
PushReplication.Changed += OnChanged;
PushReplication.Start();
PullReplication.Start();
…