Skip to content

Releases: auth0/Lock.swift

1.27.0

19 Sep 17:30
4246cf6
Compare
Choose a tag to compare

Full Changelog

Closed Issues:

  • Xcode 8 support #317
  • A0SafariAuthenticator not dismissing SFSafariViewController #308

Added:

Fixed:

2.0.0-beta.1

20 Aug 01:02
4fd1250
Compare
Choose a tag to compare
2.0.0-beta.1 Pre-release
Pre-release

Full Changelog

Lock for iOS rewritten in Swift

Usage

First to import Lock.swift

import Lock

then in your AppDelegate.swift add the following

func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
    return Lock.resumeAuth(url, options: options)
}

Configuration

In order to use Lock you need to provide your Auth0 Client Id and Domain, either with a Property List file

Auth0 ClientId & Domain can be found in your Auth0 Dashboard

Auth0.plist file

In your application bundle you can add a plist file named Auth0.plist with the following format

<?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>ClientId</key>
  <string>{YOUR_CLIENT_ID}</string>
  <key>Domain</key>
  <string>{YOUR_DOMAIN}</string>
</dict>
</plist>

Classic

Lock Classic handles authentication using Database, Social & Enterprise connections.

Currenty Lock.swift only supports Database & Social authentication and you need to tell Lock what connections it should use

To show Lock.swift, add the following snippet in any of your UIViewController

Lock
    .classic()
    .connections {
        $0.database(name: "Username-Password-Authentication", requiresUsername: true)
    }
    .options {
        $0.closable = false
    }
    .on { result in
        switch result {
        case .Success(let credentials):
            print("Obtained credentials \(credentials)")
        case .Failure(let cause):
            print("Failed with \(cause)")
        case .Cancelled:
            print("User cancelled")
        }
    }
    .present(from: self)

Specify Connections

Eventually Lock.swift will be able to load your client configuration automatically, but until then you should describe what connections it should use.

Before presenting Lock.swift you can tell it what connections it should display and use to authenticate an user. You can do that by calling the method and supply a closure that can specify the connections

.connections { connections in
    // Your connections
}

So if you need a database connection you can call

connections.database(name: "{CONNECTION_NAME}", requiresUsername: true)

Or a social connection

connections.social(name: "{CONNECTION_NAME}", style: .Facebook)

Logging

In Lock.swift options you can turn on/off logging capabilities

Lock
    .classic()
    .options {
        $0.logLevel = .All
        $0.logHttpRequest = true
    }

1.26.2

20 Aug 03:06
1b788c1
Compare
Choose a tag to compare

Full Changelog

Closed Issues:

  • The A0EnterpriseLoginViewController ignores the custom ClientId and Domain configuration #294
  • allow lock framework to enable bitcode by default #292
  • Top Level Domains on email address failing validation #248

Fixed:

1.26.1

20 Aug 01:04
b97ea9d
Compare
Choose a tag to compare

Full Changelog

Merged pull requests:

1.26.0

11 May 20:17
bca3955
Compare
Choose a tag to compare

Full Changelog

Implemented enhancements:

  • Not passing correct error code and domain #226

Fixed bugs:

  • Force Lock's UIViewControllers in portrait mode #258

Closed issues:

  • Make Error handling helper methods public #224

Merged pull requests:

1.25.0

11 Apr 11:07
37f4dff
Compare
Choose a tag to compare

Full Changelog

Merged pull requests:

  • Allow to use A0SafariAuthenticator w/o connection #254 (hzalaz)
  • Update build scripts #252 (hzalaz)
  • Use PKCE for token exchange via authorize #250 (hzalaz)

1.24.1

11 May 20:17
Compare
Choose a tag to compare

Full Changelog

Merged pull requests:

1.24.0

11 May 20:17
Compare
Choose a tag to compare

Full Changelog

Fixed bugs:

  • Properly initialise A0LockSignupViewController #246
  • Change embedded WebView title text attributes #187

Merged pull requests:

1.23.1

23 Mar 12:42
Compare
Choose a tag to compare

Full Changelog

Merged pull requests:

  • Avoid overriding connection name for social login #240 (hzalaz)

1.23.0

21 Mar 14:11
Compare
Choose a tag to compare

Full Changelog

Fixed bugs:

  • Clear cookies for UIWebView and WKWebView #227
  • Avoid cleaning reference to callbacks before calling them in A0WebKitViewController #222
  • For TouchID use default connection name if none is specified #220

Closed issues:

  • How to get the latest commits using CocoaPods? #238
  • signUpWithEmail method doesn't work properly #233
  • LICENSE file needs an update and readme.md needs a fix #215
  • connection_scopes are ignored by A0WebViewAuthenticator #209
  • Update Google Ent Auth Login screen logic #206
  • Add au region for CDN #201
  • Support customizing "user is blocked" message #195

Merged pull requests:

  • Add api_type param name to fetchNewIdTokenWithIdToken and fetchNewIdTokenWithRefreshToken #239 (rweindl)
  • If auth parameters are nil, use defaults #237 (hzalaz)
  • Avoid cleaning callbacks before vc is dismissed #236 (hzalaz)
  • Update TouchID authentication #235 (hzalaz)
  • Use new change password flow #232 (hzalaz)
  • Clear session of UIWebView & WKWebView #231 (hzalaz)
  • Fixed property inheritance warning #230 (ppaulojr)
  • Remove apple versioning from bundles #229 (hzalaz)
  • Update license and readme #216 (aguerere)
  • Update to AFNetworking 3 #213 (hzalaz)
  • Fix missing device when scope has offline_access #211 (hzalaz)
  • connection_scopes are ignored by A0WebViewAuthenticator #210 (keeth)