Other Classes
The following classes are available globally.
-
An observer which is responsible for obtaining the attestation token from SAP Mobile Services and adding it to each request header before being sent. The class also refreshes the token when the token expires.
SAP BTP SDK For iOS uses Apple’s DeviceCheck framework to assert the legitimacy of a particular instance of your application to SAP Mobile Services from where administrators can assess the fraud risk and eventually enforce HTTP communication for asserted devices only.
For more information on AppAttest: https://developer.apple.com/documentation/devicecheck/establishing_your_app_s_integrity
Use this observer by simply adding it to a
SAPURLSession
See moredo { // Create an instance of `AttestationService` using the initializer. let service = try AttestationService(sapCpmsSettingsParameters: settingsParameters, sapUrlSession: urlSession, store: persistentStore, attestationSettings: settings) // Create an instance of `AttestationObserver` using the service. let observer = AttestationObserver(attestationService: service) sapURLSession.register(observer) } catch { //catch error }
Declaration
-
This class is responsible for Application attestation and assertion with Apple. It also validates the results with SAP Mobile Services, establishing the legitimacy of an application.
To be able to use this class
App Attest
should be supported on the Apple device.SAP BTP SDK For iOS uses Apple’s DeviceCheck framework to assert the legitimacy of a particular instance of your application to SAP Mobile Services from where administrators can assess the fraud risk and eventually enforce HTTP communication for asserted devices only.
See moreDeclaration
Swift
public class AttestationService
-
Undocumented
See moreDeclaration
Swift
public class AuxiliaryDataRequestManager
-
Undocumented
See moreDeclaration
Swift
public class AuxiliaryCommunicationProvider : AuxiliaryCommunicationProviding
-
Undocumented
See moreDeclaration
Swift
public class AuxiliaryDataContainer<T> : AuxiliaryDataContainerRepresenting, Codable where T : Decodable, T : Encodable
-
Undocumented
See moreDeclaration
Swift
public class AuxiliaryDataRequest<T> : AuxiliaryDataRequestRepresenting, Codable where T : Decodable, T : Encodable
-
Undocumented
See moreDeclaration
Swift
public class AuxiliaryKeyContainer<T> : AuxiliaryKeyContainerRepresenting where T : Decodable, T : Encodable, T : Hashable
-
A type that can be passed in to the
See moreDigitalSignatureVerifying
protocol for specifying values useful in the signature verification.Declaration
Swift
public class DigitalSignatureParameter
-
This class implements
See moreDigitalSignatureVerifying
and does the digital signature verification of the passed data.Declaration
Swift
public class DigitalSignatureVerifier
extension DigitalSignatureVerifier: DigitalSignatureVerifying
-
Use this observer to detect user Lock and Wipe events from SAPcpms. When a Locked or Wiped response is detected, the provided handler is called with the specific Locked or Woped case - see
See moreLockWipePolicyError
for more information. The observer is in silent mode after this detection and will remain in this mode until a non-locking or non-wiping response is detected. The observer will not call the provided handler while in silent mode. All requests that are detected as Locked or Wiped ones will result in the appropriateLockWipePolicyError
error.Declaration
Swift
public class SAPcpmsLockAndWipeObserver : SAPURLSessionObserving
-
Class responsible for managing the logout process in the browser.
Example Usage:
Do not forget to set few things before calling logout:
In case of OAUth or SAML Authorization (with Presenter) ```swift LogoutHandler.shared.set(sapURLSession: <SAPURLSession>) LogoutHandler.shared.set(settingsParameters: <SAPcpmsSettingsParameters>) LogoutHandler.shared.set(authenticationType: <AuthenticationType>) ``` In case of Basic Authorization ```swift LogoutHandler.shared.set(sapURLSession: <SAPURLSession>) ``` In case of OAuth (with External Browser) ```swift LogoutHandler.shared.set(sapURLSession: <SAPURLSession>) LogoutHandler.shared.set(settingsParameters: <SAPcpmsSettingsParameters>) LogoutHandler.shared.set(authenticationTypeForBrowser: <AuthenticationTypeForBrowser>) ```
Do logout:
See moreLogoutHandler.shared.logout { error in if error == nil { // handle success case } else { // handle error case } }
Declaration
Swift
public class LogoutHandler
extension LogoutHandler: SAPURLSessionObserving
extension LogoutHandler : AppDelegateObserving, SceneDelegateObserving
-
This observer checks for the response header
x-app-version-inactive
denoting if the current application version is active or not in mobile services and stops user from onboarding if the version is inactive.To enable this functionality you need to register this observer to an
SAPURLSession
instance.This is an example for a typical usage of the observer:
See morelet urlSession: SAPURLSession = <#SAPURLSession instance#> let applicationVersionObserver = ApplicationVersionObserver() urlSession.register(applicationVersionObserver)
Declaration
Swift
open class ApplicationVersionObserver : SAPURLSessionObserving
-
Observer which performs necessary steps for API Key authentication
See moreDeclaration
Swift
open class APIKeyAuthenticationObserver
extension APIKeyAuthenticationObserver: SAPURLSessionObserving
-
Default implementation of
See moreAPIKeyCredentialDiscovery
Declaration
Swift
public class DefaultAPIKeyCredentialDiscovery : APIKeyCredentialDiscovery
-
See moreTokenStoreManager
is a singleton that centralizes the management of authentication tokens. It provides a centralized interface for setting and interacting with different token store implementations, allowing for flexible token management.Declaration
Swift
public class TokenStoreManager
-
Undocumented
See moreDeclaration
Swift
public class DispatcherFactory
-
Use this class to broadcast your UISceneDelegate’s methods among the registered components.
See moreDeclaration
Swift
public class SceneDelegateDispatcher : EventDispatching
-
A singleton class which manages scenes in Multi-window scenario.
See moreDeclaration
Swift
public class SceneManager
-
Undocumented
See moreDeclaration
Swift
@MainActor public class DefaultSAPWKUIDelegate : NSObject, WKUIDelegate
-
The default implementation of SAPPassportManaging protocol. This default implementation adheres to the standards mentioned for “metering” use-case by default. Users may choose to override the relevant methods to get/set passport fields differently and also to change the manager behavior in general.
See moreDeclaration
Swift
public class MeteringPassportManager : SAPPassportManaging
-
Undocumented
See moreDeclaration
Swift
public class Passport
-
CustomHeadersObserver is responsible for adding custom headers to HTTP requests made through the
SAPURLSession
.To utilize this functionality, you need to register an instance of this observer with an
SAPURLSession
. Here is an example of how to use theCustomHeadersObserver
:
See morelet urlSession: SAPURLSession = <#SAPURLSession instance#> let headers = ["Authorization": "Bearer token", "X-Custom-Header": "value"] let urlMatcher = URLMatcher(pattern: "https://api.example.com/") let customHeadersObserver = CustomHeadersObserver(headers, urlMatcher) urlSession.register(customHeadersObserver)
Declaration
Swift
public class CustomHeadersObserver : SAPURLSessionObserving
-
A class that implements URL matching based on a specified pattern URL.
See moreDeclaration
Swift
public class MatchURL : URLMatching
-
A class that implements URL matching, which matches all URLs.
See moreDeclaration
Swift
public class MatchAll : URLMatching
-
This observer is responsible to set SAP Passport header for metering. This includes the
SAP-PASSPORT
header field, which are added to each HTTP request of theSAPURLSession
.To enable this functionality you need to register this observer to an
SAPURLSession
instance.This is an example for a typical usage of the observer:
See morelet urlSession: SAPURLSession = SAPURLSession instance let passportObserver = SAPPassportObserver( ) urlSession.register(passportObserver)
Declaration
Swift
open class SAPPassportObserver : SAPURLSessionObserving
-
API to enforce a
ClipboardAccessPolicy
See moretry ClipboardProtectionEnforcer.shared.enforce(policy: .blocked) // ... during this time copied values cannot be pasted to other apps try ClipboardProtectionEnforcer.shared.enforce(policy: .unrestricted)
Declaration
Swift
public class ClipboardProtectionEnforcer
-
APIs to detect if device is compromised
See moreDeclaration
Swift
@available(iOSApplicationExtension, unavailable) public class DeviceComplianceChecker
-
Undocumented
See moreDeclaration
Swift
public class SAPcpmsDeviceSecurityAuditUploader
-
Usage
See moretry OpenURLPolicyEnforcer.shared.enforce(policy: .blocked) // ... now URLs can not be opened in an external application.
Declaration
Swift
public class OpenURLPolicyEnforcer
-
Declaration
Swift
public class PrintPolicyEnforcer
-
Undocumented
See moreDeclaration
Swift
public class AuxiliarySecurityManager
-
Undocumented
See moreDeclaration
Swift
public class SecurityManager
-
Undocumented
See moreDeclaration
Swift
public class CryptoProviderUtil
-
The default implementation of
See moreLockAndWipeManaging
protocol. This class manages LockAndWipeEventsDeclaration
Swift
public class LockAndWipeManager : LockAndWipeManaging
-
class to load the encryption configuration for a given appId and deviceId
See moreDeclaration
Swift
public class EncryptionConfigLoader
-
A class designed to handle the Telemetry Services. It is capable of managing the session start and end events, handling the custom telemetry events and uploading telemetry events data to a remote server.
This class follows the Singleton pattern, ensuring a single global instance. To store a custom event, access the API like this
Example Usage:
See moreswift TelemetryService.shared.storeCustomEvent(key: <#T##String#>, date: <#T##Date#>, duration: <#T##Double?#>)
Declaration
Swift
@objc(SAPBTPSDKTelemetryService) public class TelemetryService : NSObject
extension TelemetryService: UserEventObserving
-
Undocumented
See moreDeclaration
-
A class to dispatch the user events to store observers of type
See moreUserEventObserving
. It also provides the capability to add and remove observers. These registered observers will receive notifications for user-related events, including user added and user switch.Declaration
Swift
public class UserEventDispatcher : EventDispatching
-
Undocumented
See moreDeclaration
Swift
public final class SAPFoundationUtils