SecureBlackbox 2020 iOS Edition

Questions / Feedback?

Authenticator Class

Properties   Methods   Events   Configuration Settings   Errors  

The Authenticator class specializes in user authentication.

Syntax

SecureBlackboxAuthenticator
SecureBlackboxAuthenticatorSwift

Remarks

Authenticator provides capabilities for implementing the authenticating party (as opposed to the one being authenticated) of the authentication protocol.

Authenticator can be used in a variety of authentication scenarios, ranging from simple password checks to complicated multi-factor variants. It also supports authentication via a SBB-own DC protocol, which makes it a good pair for DCAuth control.

In default configuration the component uses the attached database of users to handle authentication requests. The authentication flow can be altered if needed to match specific authentication requirements.

In Authenticator's terms, the authentication process is divided into a sequence of atomic steps. Each step is characterized by a user providing an authentication token - such as a password or PIN - and the authenticator validating that token. Each validation step may result in one of the following outcomes:

  • Authentication succeeded: the authentication has been completed with the positive outcome;
  • Authentication failed: the authentication process has failed, the user didn't provide enough evidence to confirm they are who they claim they are;
  • Further authentication is required: the authentication was partly successful, but the settings of the component or user details require further step(s) to be taken.

Use the following logic when integrating the Authenticator into your project:

  • Whenever you receive an authentication request from a user, call the StartAuth method, passing the UserID as a parameter. This initiates the authentication procedure: the Authenticator control looks up the user in the Users database and picks the first authentication method. It then returns the Further authentication is required result and stores the details of the first authentication step in AuthInfo property. Apart from the information about the authentication method that is to be performed during this step, AuthInfo also contains a > value, which accumulates parameters and progress of the user's authentication flow. You can save the state value on this stage, and restore it later when a response from the user is received. With that in mind, class is stateless; you can save the current authentication state in a database, and return to it from a different context.
  • Now that you have obtained Further authentication needed from StartAuth, it's time to check the > and request the corresponding token from the user. For example, if the method is 'password', you may present the user with a password dialog.
  • Upon receiving a password (or other kind of authentication token) from the user, pass it to the ContinueAuth method, together with the state object that you saved on the preceding step. The component will process the token and come up with one of the three results given above, signifying the end of the first authentication step. If Further authentication is required result is returned, another authentication step needs to be performed (either because a multi-factor authentication is configured for this user, or because an alternative authentication method was chosen following failure of the previous attempt). If that is the case, follow the guidance for StartAuth-initiated step above.

    Depending on the settings, many authentication steps may need to be performed, so your code may ultimately end up calling ContinueAuth many times.

class can be customized to use external user information sources instead of a predefined user database. AuthStart, AuthVerify, and AuthAttemptResult events provide an opportunity for your code to intervene into the authentication process by defining your own authentication procedures and validating authentication tokens manually.

Property List


The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

- authInfoAuthLogContains the authentication log.
- authInfoAuthMethodContains the current authentication method.
- authInfoAuthMethodParsContains the authentication method parameters.
- authInfoCompletedMethodsContains a comma-separated list of completed authentication methods.
- authInfoLastAuthMessageContains an uninterpreted authentication message to be displayed to the authenticating user.
- authInfoLastAuthResultContains the result of the last authentication token validation.
- authInfoRemainingMethodsContains a comma-separated list of authentication methods yet to perform.
- authInfoStateContains a state of the overall authentication process.
- authInfoUserIDReturns the ID of the user being authenticated, as passed to StartAuth .
- blockedCertCountThe number of records in the BlockedCert arrays.
- blockedCertBytes:(int)blockedCertIndexReturns raw certificate data in DER format.
- blockedCertHandle:(int)blockedCertIndexAllows to get or set a 'handle', a unique identifier of the underlying property object.
- certCountThe number of records in the Cert arrays.
- certBytes:(int)certIndexReturns raw certificate data in DER format.
- certCA:(int)certIndexIndicates whether the certificate has a CA capability (a setting in BasicConstraints extension).
- certCAKeyID:(int)certIndexA unique identifier (fingerprint) of the CA certificate's private key.
- certCRLDistributionPoints:(int)certIndexLocations of the CRL (Certificate Revocation List) distribution points used to check this certificate's validity.
- certCurve:(int)certIndexSpecifies the elliptic curve of the EC public key.
- certFingerprint:(int)certIndexContains the fingerprint (a hash imprint) of this certificate.
- certFriendlyName:(int)certIndexContains an associated alias (friendly name) of the certificate.
- certHandle:(int)certIndexAllows to get or set a 'handle', a unique identifier of the underlying property object.
- certHashAlgorithm:(int)certIndexSpecifies the hash algorithm to be used in the operations on the certificate (such as key signing) SB_HASH_ALGORITHM_SHA1 SHA1 SB_HASH_ALGORITHM_SHA224 SHA224 SB_HASH_ALGORITHM_SHA256 SHA256 SB_HASH_ALGORITHM_SHA384 SHA384 SB_HASH_ALGORITHM_SHA512 SHA512 SB_HASH_ALGORITHM_MD2 MD2 SB_HASH_ALGORITHM_MD4 MD4 SB_HASH_ALGORITHM_MD5 MD5 SB_HASH_ALGORITHM_RIPEMD160 RIPEMD160 SB_HASH_ALGORITHM_CRC32 CRC32 SB_HASH_ALGORITHM_SSL3 SSL3 SB_HASH_ALGORITHM_GOST_R3411_1994 GOST1994 SB_HASH_ALGORITHM_WHIRLPOOL WHIRLPOOL SB_HASH_ALGORITHM_POLY1305 POLY1305 SB_HASH_ALGORITHM_SHA3_224 SHA3_224 SB_HASH_ALGORITHM_SHA3_256 SHA3_256 SB_HASH_ALGORITHM_SHA3_384 SHA3_384 SB_HASH_ALGORITHM_SHA3_512 SHA3_512 SB_HASH_ALGORITHM_BLAKE2S_128 BLAKE2S_128 SB_HASH_ALGORITHM_BLAKE2S_160 BLAKE2S_160 SB_HASH_ALGORITHM_BLAKE2S_224 BLAKE2S_224 SB_HASH_ALGORITHM_BLAKE2S_256 BLAKE2S_256 SB_HASH_ALGORITHM_BLAKE2B_160 BLAKE2B_160 SB_HASH_ALGORITHM_BLAKE2B_256 BLAKE2B_256 SB_HASH_ALGORITHM_BLAKE2B_384 BLAKE2B_384 SB_HASH_ALGORITHM_BLAKE2B_512 BLAKE2B_512 SB_HASH_ALGORITHM_SHAKE_128 SHAKE_128 SB_HASH_ALGORITHM_SHAKE_256 SHAKE_256 SB_HASH_ALGORITHM_SHAKE_128_LEN SHAKE_128_LEN SB_HASH_ALGORITHM_SHAKE_256_LEN SHAKE_256_LEN .
- certIssuer:(int)certIndexThe common name of the certificate issuer (CA), typically a company name.
- certIssuerRDN:(int)certIndexA collection of information, in the form of [OID, Value] pairs, uniquely identifying the certificate issuer.
- certKeyAlgorithm:(int)certIndexSpecifies the public key algorithm of this certificate.
- certKeyBits:(int)certIndexReturns the length of the public key.
- certKeyFingerprint:(int)certIndexReturns a fingerprint of the public key contained in the certificate.
- certKeyUsage:(int)certIndexIndicates the purposes of the key contained in the certificate, in the form of an OR'ed flag set.
- certKeyValid:(int)certIndexReturns True if the certificate's key is cryptographically valid, and False otherwise.
- certOCSPLocations:(int)certIndexLocations of OCSP (Online Certificate Status Protocol) services that can be used to check this certificate's validity, as recorded by the CA.
- certPolicyIDs:(int)certIndexContains identifiers (OIDs) of the applicable certificate policies.
- certPublicKeyBytes:(int)certIndexContains the certificate's public key in DER format.
- certSelfSigned:(int)certIndexIndicates whether the certificate is self-signed (root) or signed by an external CA.
- certSerialNumber:(int)certIndexReturns the certificate's serial number.
- certSigAlgorithm:(int)certIndexIndicates the algorithm that was used by the CA to sign this certificate.
- certSubject:(int)certIndexThe common name of the certificate holder, typically an individual's name, a URL, an e-mail address, or a company name.
- certSubjectKeyID:(int)certIndexContains a unique identifier (fingerprint) of the certificate's private key.
- certSubjectRDN:(int)certIndexA collection of information, in the form of [OID, Value] pairs, uniquely identifying the certificate holder (subject).
- certValidFrom:(int)certIndexThe time point at which the certificate becomes valid, in UTC.
- certValidTo:(int)certIndexThe time point at which the certificate expires, in UTC.
- chainValidationDetailsThe details of a certificate chain validation outcome.
- chainValidationResultThe general outcome of a certificate chain validation routine. Use ChainValidationDetails to get information about the reasons that contributed to the validation result.
- defaultAuthMethodsContains the list of default authentication methods.
- externalCryptoCustomParamsCustom parameters to be passed to the signing service (uninterpreted).
- externalCryptoDataAdditional data to be included in the async state and mirrored back by the requestor.
- externalCryptoExternalHashCalculationSpecifies whether the message hash is to be calculated at the external endpoint.
- externalCryptoHashAlgorithmSpecifies the request's signature hash algorithm.
- externalCryptoKeyIDThe ID of the pre-shared key used for DC request authentication.
- externalCryptoKeySecretThe pre-shared key used for DC request authentication.
- externalCryptoMethodSpecifies the asynchronous signing method.
- externalCryptoModeSpecifies the external cryptography mode.
- externalCryptoPublicKeyAlgorithmProvide public key algorithm here if the certificate is not available on the pre-signing stage.
- ignoreChainValidationErrorsMakes the class tolerant to chain validation errors.
- knownCertCountThe number of records in the KnownCert arrays.
- knownCertBytes:(int)knownCertIndexReturns raw certificate data in DER format.
- knownCertHandle:(int)knownCertIndexAllows to get or set a 'handle', a unique identifier of the underlying property object.
- knownCRLCountThe number of records in the KnownCRL arrays.
- knownCRLBytes:(int)knownCRLIndexReturns raw CRL data in DER format.
- knownCRLHandle:(int)knownCRLIndexAllows to get or set a 'handle', a unique identifier of the underlying property object.
- knownOCSPCountThe number of records in the KnownOCSP arrays.
- knownOCSPBytes:(int)knownOCSPIndexBuffer containing raw OCSP response data.
- knownOCSPHandle:(int)knownOCSPIndexAllows to get or set a 'handle', a unique identifier of the underlying property object.
- offlineModeSwitches the class to the offline mode.
- proxyAddressThe IP address of the proxy server.
- proxyAuthenticationThe authentication type used by the proxy server.
- proxyPasswordThe password to authenticate to the proxy server.
- proxyPortThe port on the proxy server to connect to.
- proxyProxyTypeThe type of the proxy server.
- proxyRequestHeadersContains HTTP request headers for WebTunnel and HTTP proxy.
- proxyResponseBodyContains the HTTP or HTTPS (WebTunnel) proxy response body.
- proxyResponseHeadersContains response headers received from an HTTP or HTTPS (WebTunnel) proxy server.
- proxyUseIPv6Specifies whether IPv6 should be used when connecting through the proxy.
- proxyUseProxyEnables or disables proxy-driven connection.
- proxyUsernameSpecifies the username credential for proxy authentication.
- revocationCheckSpecifies the kind(s) of revocation check to perform.
- signingCertBytesReturns raw certificate data in DER format.
- signingCertHandleAllows to get or set a 'handle', a unique identifier of the underlying property object.
- socketDNSModeSelects the DNS resolver to use: the class's (secure) built-in one, or the one provided by the system.
- socketDNSPortSpecifies the port number to be used for sending queries to the DNS server.
- socketDNSQueryTimeoutThe timeout (in milliseconds) for each DNS query.
- socketDNSServersThe addresses of DNS servers to use for address resolution, separated by commas or semicolons.
- socketDNSTotalTimeoutThe timeout (in milliseconds) for the whole resolution process.
- socketIncomingSpeedLimitThe maximum number of bytes to read from the socket, per second.
- socketLocalAddressThe local network interface to bind the socket to.
- socketLocalPortThe local port number to bind the socket to.
- socketOutgoingSpeedLimitThe maximum number of bytes to write to the socket, per second.
- socketTimeoutThe maximum period of waiting, in milliseconds, after which the socket operation is considered unsuccessful.
- socketUseIPv6Enables or disables IP protocol version 6.
- TLSAutoValidateCertificatesSpecifies whether server-side TLS certificates should be validated automatically using internal validation rules.
- TLSBaseConfigurationSelects the base configuration for the TLS settings.
- TLSCiphersuitesA list of ciphersuites separated with commas or semicolons.
- TLSECCurvesDefines the elliptic curves to enable.
- TLSForceResumeIfDestinationChangesWhether to force TLS session resumption when the destination address changes.
- TLSPreSharedIdentityDefines the identity used when the PSK (Pre-Shared Key) key-exchange mechanism is negotiated.
- TLSPreSharedKeyContains the pre-shared for the PSK (Pre-Shared Key) key-exchange mechanism, encoded with base16.
- TLSPreSharedKeyCiphersuiteDefines the ciphersuite used for PSK (Pre-Shared Key) negotiation.
- TLSRenegotiationAttackPreventionModeSelects renegotiation attack prevention mechanism.
- TLSRevocationCheckSpecifies the kind(s) of revocation check to perform.
- TLSSSLOptionsVarious SSL (TLS) protocol options, set of cssloExpectShutdownMessage 0x001 Wait for the close-notify message when shutting down the connection cssloOpenSSLDTLSWorkaround 0x002 (DEPRECATED) Use a DTLS version workaround when talking to very old OpenSSL versions cssloDisableKexLengthAlignment 0x004 Do not align the client-side PMS by the RSA modulus size.
- TLSTLSModeSpecifies the TLS mode to use.
- TLSUseExtendedMasterSecretEnables Extended Master Secret Extension, as defined in RFC 7627.
- TLSUseSessionResumptionEnables or disables TLS session resumption capability.
- TLSVersionsTh SSL/TLS versions to enable by default.
- trustedCertCountThe number of records in the TrustedCert arrays.
- trustedCertBytes:(int)trustedCertIndexReturns raw certificate data in DER format.
- trustedCertHandle:(int)trustedCertIndexAllows to get or set a 'handle', a unique identifier of the underlying property object.
- userCountThe number of records in the User arrays.
- userAssociatedData:(int)userIndexContains the user's Associated Data when SSH AEAD (Authenticated Encryption with Associated Data) algorithm is used.
- userBasePath:(int)userIndexBase path for this user in the server's file system.
- userCert:(int)userIndexContains the user's certificate.
- userData:(int)userIndexContains uninterpreted user-defined data that should be associated with the user account, such as comments or custom settings.
- userHandle:(int)userIndexAllows to get or set a 'handle', a unique identifier of the underlying property object.
- userHashAlgorithm:(int)userIndexSpecifies the hash algorithm used to generate TOTP (Time-based One-Time Passwords) passwords for this user.
- userIncomingSpeedLimit:(int)userIndexSpecifies the incoming speed limit for this user.
- userOtpAlgorithm:(int)userIndexThe algorithm used to generate one-time passwords (OTP) for this user, either HOTP (Hash-based OTP) or TOTP (Time-based OTP).
- userOtpValue:(int)userIndexThe user's time interval (TOTP) or Counter (HOTP).
- userOutgoingSpeedLimit:(int)userIndexSpecifies the outgoing speed limit for this user.
- userPassword:(int)userIndexThe user's authentication password.
- userPasswordLen:(int)userIndexSpecifies the length of the user's OTP password.
- userSharedSecret:(int)userIndexContains the user's secret key, which is essentially a shared secret between the client and server.
- userSSHKey:(int)userIndexContains the user's SSH key.
- userUsername:(int)userIndexThe registered name (login) of the user.
- validationLogContains the complete log of the certificate validation routine.
- validationMomentThe time point at which signature validity is to be established.

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

- configSets or retrieves a configuration setting.
- continueAuthCall this method to process an authentication token and proceed to the next authentication step.
- startAuthInitiates an authentication process.

Event List


The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

- onAuthAttemptResultReports the outcome of an authentication attempt.
- onAuthAttemptStartSignifies the start of an authentication attempt.
- onAuthStartSignifies the start of an authentication process.
- onAuthVerifyRequests the application to validate an authentication token.
- onCustomAuthStartReports the beginning of a custom authentication method.
- onErrorReports information about errors during authentication.
- onNotificationThis event notifies the application about an underlying control flow event.

Configuration Settings


The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.

ForceCompleteChainValidationForTrustedWhether to continue with the full validation up to the root CA certificate for mid-level trust anchors.
IgnoreOCSPNoCheckExtensionWhether OCSP NoCheck extension should be ignored.
IgnoreSystemTrustWhether trusted Windows Certificate Stores should be treated as trusted.
ImplicitlyTrustSelfSignedCertificatesWhether to trust self-signed certificates.
PromoteLongOCSPResponsesWhether long OCSP responses are requested.
TolerateMinorChainIssuesWhether to tolerate minor chain issues.
UseMicrosoftCTLEnables or disables automatic use of Microsoft online certificate trust list.
UseSystemCertificatesEnables or disables the use of the system certificates.
CheckKeyIntegrityBeforeUseEnables or disable private key integrity check before use.
CookieCachingSpecifies whether a cookie cache should be used for HTTP(S) transports.
CookiesGets or sets local cookies for the class (supported for HTTPClient, RESTClient and SOAPClient only).
DefDeriveKeyIterationsSpecifies the default key derivation algorithm iteration count.
EnableClientSideSSLFFDHEEnables or disables finite field DHE key exchange support in TLS clients.
GlobalCookiesGets or sets global cookies for all the HTTP transports.
HttpUserAgentSpecifies the user agent name to be used by all HTTP clients.
LogDestinationSpecifies the debug log destination.
LogDetailsSpecifies the debug log details to dump.
LogFileSpecifies the debug log filename.
LogFiltersSpecifies the debug log filters.
LogFlushModeSpecifies the log flush mode.
LogLevelSpecifies the debug log level.
LogMaxEventCountSpecifies the maximum number of events to cache before further action is taken.
LogRotationModeSpecifies the log rotation mode.
MaxASN1BufferLengthSpecifies the maximal allowed length for ASN.1 primitive tag data.
MaxASN1TreeDepthSpecifies the maximal depth for processed ASN.1 trees.
OCSPHashAlgorithmSpecifies the hash algorithm to be used to identify certificates in OCSP requests.
UseOwnDNSResolverSpecifies whether the client classes should use own DNS resolver.
UseSharedSystemStoragesSpecifies whether the validation engine should use a global per-process copy of the system certificate stores.
UseSystemOAEPAndPSSEnforces or disables the use of system-driven RSA OAEP and PSS computations.
UseSystemRandomEnables or disables the use of the OS PRNG.

Copyright (c) 2022 /n software inc. - All rights reserved.
SecureBlackbox 2020 iOS Edition - Version 20.0 [Build 8166]