website logo
⌘K
Getting Started
Use Cases
Secure, Passwordless Login via Standard Protocols (OIDC, SAML2)
BlokSec for MFA / 2FA
Adding Passwordless Login to your In-House / Custom Application
BlokSec yuID Authenticator App
BlokSec Admin Console
FAQ's
Integrations
Microsoft 0365
Google Workspace
Salesforce
Dropbox
CyberArk Privileged Access Manager
IBM Security Verify
Custom OIDC
Custom SAML2
BlokSec SDK Integration (iOS)
Compatibility
Dependencies
Prerequisites
SDK Usage (Initialise)
New User Registration
Authentication
Account Association
Restore/Backup
API Reference
Docs powered by archbee 
5min

API Reference

Shared Instance API

Swift
|
/// Shared Instance to interact with the SDK
  public static let shared: BlokSecFramework.BlokSecSDK?


User Registration API

Swift
|
/** This method is used to register the User with the specified Registration Request
 - Parameters:
- request: request of type BSRegistrationRequest containing relevant information to get registered
*/
 func registerUser(request: BlokSecFramework.BSRegistrationRequest, withCompletion completion: BlokSecFramework.BlokSecSDKStartCompletion?)
 /** This Method is used to raise the registration  request for use
 - Parameters:
 - request:  registration request of type BSRaiseRegistrationRequest
- completion: Completion Closure providing the registration id of user
*/
 func raiseRegistrationRequest(request: BlokSecFramework.BSRaiseRegistrationRequest, withCompletion completion: @escaping BlokSecFramework.RaiseRegistrationRequestResponse)


Account Association APIs

Swift
|
/** This Method is used to get the registration details of user
- Parameters:
- registrationId:  registration Id to fetch the details of registration of user
- completion: Completion Closure providing the registration details of user of type RegistrationDetailsResponse
*/
 func getRegistrationDetails(registrationId: String, completion: @escaping BlokSecFramework.RegistrationDetailsResponse)
/** This Method is used to complete the registration of account
- Parameters:
- accountRequest:  account Request containing the meta data to create the account
- completion: Completion Closure providing the created account or error of type CreateAccountResponse
*/
func completeRegistration(accountRequest: BlokSecFramework.BSAccountRequest, completion: @escaping BlokSecFramework.CreateAccountResponse)


Authentication APIs

Swift
|
/** This Method is used to raise the authentication request for use
- Parameters:
- request:  auth request of type BSRaiseAuthenticationRequest
- completion: Completion Closure providing the registration id of user
*/
func raiseAuthenticationRequest(request: BlokSecFramework.BSRaiseAuthenticationRequest, withCompletion completion: @escaping BlokSecFramework.RaiseAuthenticationRequestResponse)

/** This Method is used to authenticate the user for particular application
- Parameters:
- requestId: Auth request Id received in universal URL or push notification to authenticated
- completion: Completion Closure providing the response of authentication or error of type AuthenticateRequestResponse
*/
func getAuthenticationRequest(requestId: String, completion: @escaping BlokSecFramework.AuthenticateRequestResponse)
/** This Method is used to authenticate the user for particular application
- Parameters:
- latestpushNotificationRequestModel: Auth request Id received in universal URL or push notification to authenticated
- completion: Completion Closure providing the response of authentication or error of type AuthenticateUserResponse
*/
func sendAuthenticationResponse(authRequest: BlokSecFramework.BSAuthenticationRequest, completion: @escaping BlokSecFramework.AuthenticateUserResponse)


Backup API

Returns a QR code which can be used later to restore the user's complete account tree. Note that a passphrase is used to encrypt the data; this passphrase must be supplied during the restore process in order to decrypt the incoming data. Without the valid passphrase, the QR code contains unusable, encrypted binary data.

Swift
|
/** This method returns the QR Image for the backed up account with the specified passphrase
- Parameters:
- passphrase: Passphrase entered by user to backup the Account
- Returns: Returns QR Code Image associated to the backup
*/
func createBackupQRCode(withPass passphrase: String) -> UIImage?


Restore API

Swift
|
/** This method is used to restore the Account from QR Info with the passphrase used during the backup
- Parameters:
- qrInfo: QR Info Retrieved by reading the QR of type String
- passphrase: Passphrase entered by user to restore the Account of type String
- deviceToken: Device Token in which the account needs to be restored of type optional String
- completion: Completion Closure of type UserProfileCompletion that provides information of restored account
*/
func restoreFromQRCode(_ qrInfo: String, usingPassPhrase passphrase: String, inDevice deviceToken: String?, withCompletion completion: @escaping BlokSecFramework.UserProfileCompletion) throws


Helper APIs

Swift
|
/** This Method is used to fetch the user Profile from Server
- Parameters:
- completion: Completion Closure providing the response of user profile or error of type UserProfileCompletion
*/
func getUserProfile(withCompletion completion: @escaping BlokSecFramework.UserProfileCompletion)




Updated 03 Mar 2023
Did this page help you?
Yes
No
Docs powered by archbee 
TABLE OF CONTENTS
Shared Instance API
User Registration API
Account Association APIs
Authentication APIs
Backup API
Restore API
Helper APIs