GithubHelp home page GithubHelp logo

kagii-ios's Introduction

Kagii iOS SDK

Kagii protects the enterprise by carefully authenticating authorized users seeking access to the network and to applications. Grant users secure access to all protected applications (on-premises or cloud-based) through a uniform, frictionless interface accessible from anywhere.

Full example

A full example which integrates Kagii SDK with KYCExpert SDK is available in the repository Sedicii/KYCexpert-High-Assurance-Example

Requirements

  • iOS 13.0 and higher
  • Internet connection
  • Permissions for camera

Permissions

The permissions declared in the SDK are assigned automatically to the client application.

According to the Apple documentation, an iOS app linked on or after iOS 10.0, must describe the reason why your app needs that permission.

It is necessary to include the NSCameraUsageDescription, NSPhotoLibraryUsageDescription and NSMicrophoneUsageDescription keys in your app's Info.plist file and provide a purpose string for this key.

Include SDK in Project

This framework can be included in your project with Carthage:

github "Sedicii/Kagii-iOS"

Or you can include it manually downloading the latest version.

Dependencies

This framework depends on the following frameworks:

github "marmelroy/PhoneNumberKit"
github "Sedicii/SediciiCoreSDK-iOS"
github "Sedicii/SediciiZkpSDK-iOS"

You can include them manually downloading SediciiCoreSDK latest version and SediciiZkpSDK latest version

SDK Configuration

These are the available variables to configure the SDK:

Name Required Description
API_ENDPOINT true The API_ENDPOINT of the backend used by the SDK, Sedicii will provide it.
API_KEY true The API_KEY of the backend used by the SDK, Sedicii will provide it.
CLIENT_ID true The CLIENT_ID is the unique identifier of the client, Sedicii will provide it.
REDIRECT_URI true The REDIRECT_URI of the authorised domain, Sedicii will provide it.
PASSWORD_CONFIRM_NEEDED false If true, it'll show a password confirmation field. By default, it's false.

To configure the SDK in iOS a plist type file is needed located in the main project path, with name Kagii-Info.plist (make sure it is added in BuildPhases > Copy Bundle Resources), which can have the following values:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>API_ENDPOINT</key>
        <string>https://example.acc.sedicii.com</string>
        <key>API_KEY</key>
        <string>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</string>
        <key>CLIENT_ID</key>
        <string>example</string>
        <key>REDIRECT_URI</key>
        <string>https://example.kyc.sedicii.com/admin/login</string>
        <key>PASSWORD_CONFIRM_NEEDED</key>
        <true/>
    </dict>
</plist>

SDK Initialisation

To initialise the SDK, it is needed to call the method Kagii.userInterface.logInUser as follows:

Kagii.userInterface.logInUser { kagiiResult in
    switch kagiiResult {
    case .failure(let error):
        // error - LogInUserError
    case .success(let response):
        // response - LogInUserResponse
    }
}

LogInUserError

LogInUserError is the enumeration which is returned in case of failure in the Kagii.userInterface.logInUser call.

public enum LogInUserError: Error {
    case error(Error)
    case sdkClosed
}

LogInUserResponse

LogInUserResponse is the data structure which is returned in the successfull case in the Kagii.userInterface.logInUser call.

public struct LogInUserData {
    public var id: String
}

public struct LogInUserResponse {
    public var user: LogInUserData
    public var code: String
}

Appearance

The full appearance definition is available in appearance section.

Defining the appearance. This is way to define your own appearance.

Kagii.userInterface.appearance = ClientAppearance.appearance

Logging

Also, it is allowed the definition of the logging level as follows:

Kagii.loggerLevel = .none

where the logging levels are:

    case none
    case error
    case warning
    case info
    case debug
    case trace

kagii-ios's People

Contributors

nalvarezdiaz avatar

Watchers

James Cloos avatar Sergio Medina avatar  avatar Dima Derenchuk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.