![]() |
Couchbase Lite
Objective-C API for iOS and Mac OS
|
The CBLAuthenticator class provides factory methods for creating authenticator objects, for use with the .authenticator property of a CBLReplication.
Instance Methods | |
| (instancetype) | - NS_UNAVAILABLE |
Class Methods | |
| (id< CBLAuthenticator >) | + basicAuthenticatorWithName:password: |
| Creates an authenticator that will log in using HTTP Basic auth with the given user name and password. More... | |
| (id< CBLAuthenticator >) | + facebookAuthenticatorWithToken: |
| Creates an authenticator that will authenticate to a Couchbase Sync Gateway server using Facebook credentials. More... | |
| (id< CBLAuthenticator >) | + personaAuthenticatorWithAssertion: |
| Creates an authenticator that will authenticate to a Couchbase Sync Gateway server using the user's email address, with the Persona protocol (http://persona.org). More... | |
| (id< CBLAuthenticator >) | + OAuth1AuthenticatorWithConsumerKey:consumerSecret:token:tokenSecret:signatureMethod: |
| Creates an authenticator that will authenticate to a CouchDB server using OAuth version 1. More... | |
| (id< CBLAuthenticator >) | + SSLClientCertAuthenticatorWithIdentity:supportingCerts: |
| Creates an authenticator that uses an SSL/TLS client certificate. More... | |
| (nullable id< CBLAuthenticator >) | + SSLClientCertAuthenticatorWithAnonymousIdentity: |
| (id< CBLAuthenticator >) | + OpenIDConnectAuthenticator: |
| Creates an authenticator for use with OpenID Connect (NOT any earlier versions of OpenID.) This authenticator will use an ID token saved in the Keychain; if there isn't one, or if it's expired and can't be renewed, then a login is required, which will involve user interaction with a login web page run by the identity provider. More... | |
| + (id<CBLAuthenticator>) basicAuthenticatorWithName: | (NSString *) | name | |
| password: | (NSString *) | password | |
Creates an authenticator that will log in using HTTP Basic auth with the given user name and password.
This should only be used over an SSL/TLS connection, as otherwise it's very easy for anyone sniffing network traffic to read the password.
| + (id<CBLAuthenticator>) facebookAuthenticatorWithToken: | (NSString *) | token |
Creates an authenticator that will authenticate to a Couchbase Sync Gateway server using Facebook credentials.
The token string must be an active Facebook login token. On iOS you can acquire one from the Accounts framework, or you can use Facebook's SDK to implement the login process.
| + (id<CBLAuthenticator>) personaAuthenticatorWithAssertion: | (NSString *) | assertion |
Creates an authenticator that will authenticate to a Couchbase Sync Gateway server using the user's email address, with the Persona protocol (http://persona.org).
The "assertion" token must have been acquired using the client-side Persona auth procedure; you can use the library https://github.com/couchbaselabs/browserid-ios to do this.
| + (id<CBLAuthenticator>) OAuth1AuthenticatorWithConsumerKey: | (NSString *) | consumerKey | |
| consumerSecret: | (NSString *) | consumerSecret | |
| token: | (NSString *) | token | |
| tokenSecret: | (NSString *) | tokenSecret | |
| signatureMethod: | (NSString *) | signatureMethod | |
Creates an authenticator that will authenticate to a CouchDB server using OAuth version 1.
The parameters must have been acquired using the client-side OAuth login procedure. There are several iOS and Mac implementations of this, such as https://github.com/couchbaselabs/ios-oauthconsumer
| + (id<CBLAuthenticator>) SSLClientCertAuthenticatorWithIdentity: | (SecIdentityRef) | identity | |
| supportingCerts: | (nullable NSArray *) | certs | |
Creates an authenticator that uses an SSL/TLS client certificate.
| identity | The identity certificate plus private key |
| certs | Any additional CA certs needed to establish the chain of authority. |
| + (nullable id<CBLAuthenticator>) SSLClientCertAuthenticatorWithAnonymousIdentity: | (NSString *) | label |
| - (instancetype) NS_UNAVAILABLE |
| + (id<CBLAuthenticator>) OpenIDConnectAuthenticator: | (CBLOIDCLoginCallback) | callback |
Creates an authenticator for use with OpenID Connect (NOT any earlier versions of OpenID.) This authenticator will use an ID token saved in the Keychain; if there isn't one, or if it's expired and can't be renewed, then a login is required, which will involve user interaction with a login web page run by the identity provider.
Since Couchbase Lite doesn't have its own UI, it delegates this task to your app.
The replicator will call your login callback, passing it the URL of this web page and the URL to which the identity provider will redirect when the login is complete. You then open a WebView and let the login happen asynchronously. When it completes, you call the CBLOIDCLoginContinuation callback that was also passed to your login callback.
Please see the docs of the CBLOIDCLoginCallback and CBLOIDCLoginContinuation types for more details.
Provided by category CBLAuthenticator(OpenID).