Authenticate
authenticate()
Authenticates apiKey with the Svrf API using the Authenticate Endpoint.
If an apiKey parameter is not provided, this method will use the SVRF_API_KEY value in the project plist. If an apiKey parameter is set, it will be used over a plist value.
Once authenticated, the SvrfSDK will automatically add authentication tokens to request headers and will fetch a new token if it has expired.
Declaration
func authenticate(apiKey: String? = nil,onSuccess success: (() -> Void)? = nil,onFailure failure: Optional<(_ error: SvrfError) -> Void> = nil)
Parameters
| Parameter | Description |
|---|---|
| apiKey | Svrf API Key. |
| success | Success closure. |
| failure | Error closure. |
| -- error | A SvrfError. |