Latest 1.4.6
License Apache License, Version 2.0
Platforms ios 9.0, requires ARC
Dependencies AeroGearHttp, JSONWebToken
Frameworks Security


OAuth2 Client based on aerogear-ios-http.


  • account manager for multiple OAuth2 accounts,
  • request access and refresh token,
  • grant access through secure browser and URI schema to re-enter app,
  • (implicit or explicit) refresh tokens,
  • revoke tokens,
  • permanent secure storage,

Swift 4.0

Please use the GitHub Watch feature to get notified on new releases of the SDK.

Hello World app using the SDK

The easiest way to get started is looking at the Hello World example app.

Implements the API’s for

Documentation on the project forked from can be found at

Build, test and play with connect-ios-sdk

  1. Clone this project

  2. Get the dependencies

The project uses CocoaPods for handling its dependencies. As a pre-requisite, install CocoaPods and then install the pod. On the root directory of the project run:

pod install
  1. open TDConnectIosSdk.xcworkspace

Adding the library to your project

To add the library in your project, you can either use CocoaPods or manual install in your project. See the respective sections below for instructions:

Using CocoaPods

In your Podfile add:

pod 'TDConnectIosSdk'

and then:

pod install

to install your dependencies

Manual Installation

Follow these steps to add the library in your Swift project:

  1. Add TDConnectIosSdk as a submodule in your project. Open a terminal and navigate to your project directory. Then enter:
    git submodule add
  2. Open the connect-ios-sdk folder, and drag the TDConnectIosSdk.xcodeproj into the file navigator in Xcode.
  3. In Xcode select your application target and under the "Targets" heading section, ensure that the ‘iOS Deployment Target’ matches the application target of TDConnectIosSdk.framework (Currently set to 8.0).
  4. Select the "Build Phases" heading section, expand the "Target Dependencies" group and add TDConnectIosSdk.framework.
  5. Click on the + button at the top left of the panel and select "New Copy Files Phase". Rename this new phase to "Copy Frameworks", set the "Destination" to "Frameworks", and add TDConnectIosSdk.framework.

Using Carthage

Create Cartfile in your project that contains

github "telenordigital/connect-ios-sdk"

Because the SDK project manages it’s depencies with Cocoapods you will have to install the SDK depencies with Cocoapod locally, even though you don’t have to use it for your project

carthage update # this will give an error but will generate the files needed
cd Carthage/Checkouts/connect-ios-sdk
pod install
cd ../../..
carthage update

Note: Make sure you have the latest version of Cocoapods (1.4.0 at the time of writing)

Advanced Usage

Confidential Client

To set the SDK to Confidential Client mode set the optional init parameter in the Config object named isPublicClient to false. Otherwise it will default to a public client.
A confidential client will not exchange the authorization code but simply return this to the client through the callback. The app code can then send this to the server-side component of the client.

See for more information.

override func viewDidAppear(_ animated: Bool) {
    let config = TelenorConnectConfig(clientId: "telenordigital-connectexample-ios",
                                      redirectUrl: "telenordigital-connectexample-ios://oauth2callback",
                                      useStaging: true,
                                      scopes: ["profile", "openid", "email"],
                                      accountId: "telenor-connect-ios-hello-world",
                                      isPublicClient: false) // this variable needs to be present

    let oauth2Module = AccountManager.getAccountBy(config: config)
        ?? AccountManager.addAccountWith(config: self.config, moduleClass: TelenorConnectOAuth2Module.self)

    oauth2Module.requestAuthorizationCode { (authorizationCode: AnyObject?, error: NSError?) in
        if (error != nil) {
            // handle error

        // use authorizationCode

Latest podspec

    "name": "TDConnectIosSdk",
    "version": "1.4.6",
    "summary": "OAuth2 client library based on aerogear-ios-http",
    "homepage": "",
    "license": "Apache License, Version 2.0",
    "authors": "Telenor Digital",
    "source": {
        "git": "",
        "tag": "1.4.6"
    "platforms": {
        "ios": "9.0"
    "source_files": [
    "vendored_libraries": "TDConnectIosSdk/libs/curl/lib/libcurl.a",
    "libraries": "z",
    "requires_arc": true,
    "frameworks": "Security",
    "dependencies": {
        "AeroGearHttp": [],
        "JSONWebToken": []

Pin It on Pinterest

Share This