Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time

How To...

Connect OAuth provider with Client Keys

Connect OAuth provider with Client Keys Salt Edge now supports Account Information Services channels, which can be used with PSD2 and Open Banking compliant APIs.

Read about it in Salt Edge Documentation

  1. Register application deep-link (Custom URL Scheme, in example below it'll be custom_scheme) for your app target. See official Apple documentation.

  2. Create a returnTo constant as application deep link, which you will use for createConnectSession.

    static let returnTo = "custom_scheme://custom_host/custom_path"
  3. Fetch providers and select one.

    let params = SEProviderParams(fromId: 108)
    SERequestManager.shared.getProviders(with: params) { response in
        // handle response here.
  4. Create Connect Session. In SEConnectSessionsParams add SEAttempt object with your returnTo url.

    let params = SEConnectSessionsParams(
        attempt: SEAttempt(returnTo: returnTo),
        providerCode: provider?.code,
        disableProvidersSearch: true,
        consent: consent
        params: params,
        completion: { [weak self] response in
            // Use recieved response.connectUrl
  5. Check Provier mode. If mode is oauth then open received connectUrl in external app, otherwise open it in webView.

    func handleConnectSessionResponse(_ response: SEConnectSessionResponse) {
        guard let url = URL(string: response.connectUrl) else { return }
        // Check if provider mode is "oauth". Then try to open it in external browser or app.
        if let provider = self.provider, provider.isOAuth, UIApplication.shared.canOpenURL(url) {
        } else {
            let request = URLRequest(url: url)
  6. All connect operations (Authorizations, Fetching, etc.) will be performed in external app.

  7. After openning your app with deepLink, handle it in your AppDelegate.swift, using next method:

    func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
            SERequestManager.shared.handleOpen(url: url, connectionFetchingDelegate: yourDelegate)
            return true

App-2-App redirect

The most common case of Salt Edge Connect usage is when TPP application initiate connect of Account and opens Salt Edge Connect url in WKWebView. There are a lot of banks which require authentication/authorization in bank applications, but in that case redirection outside of will remain in WKWebView and flow will get stuck.

First solution is to open all Salt Edge Connect URL's (or URL's for oauth providers) in external browser/application.
app-2-app redirect base flow

Second solution is to open Salt Edge Connect in the WKWebView and handle all redirections outside Salt Edge ( and open them in external browser/application.
app-2-app redirect hybrid flow

Instead of WKWebView you can open url in SFSafariViewController.

After successful authentication user will be redirected back to TPP app. We propose to use deep-link with custom scheme (like: mytpp:// as return url. Same type of deeplink uniquely identify your application in the system and eliminate doubts where to redirect, as well as they are easy to implement.

Copyright © 2014 Salt Edge Inc.