Couchbase openIDConnect身份验证ios

时间:2017-12-30 10:51:13

标签: ios couchbase-lite couchbase-sync-gateway

我正在尝试使用couchbase DB并使用授权代码流为其设置身份验证。我按照link中的步骤进行操作。我相应地准备了ConfigJson。使用Pods我为ios安装了Couchbase lite,并以下列方式提供了验证器:

let url = URL.init(string: "http://my-ip:4984/project_name/_oidc")!
pusher = database.createPushReplication(url)
pusher.continuous = true
let authenticator = CBLAuthenticator.openIDConnect({(loginURL: URL, redirectURL: URL, Nonnull: CBLOIDCLoginContinuation) -> Void in

                    print(loginURL,redirectURL)
                })
                pusher.authenticator = authenticator
                pusher.start()

但是,当我在终端“http://my-ip:4984/project_name/_oidc/_session”中检查它时,而是我没有收到任何回调移动设备。我究竟做错了什么?对不起,我只是个初学者。为什么最后会添加_session?

1 个答案:

答案 0 :(得分:1)

您需要设置数据库的URL,而不是设置_oidc端点。 Couchbase Lite的Open ID Connect身份验证器负责验证身份验证步骤。

所以,你需要使用let url = URL.init(string: "http://my-ip:4984/project_name/")!