Skip to content

Commit

Permalink
Master <-- Development (#180)
Browse files Browse the repository at this point in the history
* update login widget section in readme

* changing initializer to public (#171)

* Point to v4 (#173)

* Update to point to v4 + iss and aud validation
 Adds azp and issuer validation for V4

* Issue 2439 (#174)

Removed azp validation and updated tokens to v4 for tests

* bump up version to 6.0.0

* Issue 3201 (#177)

* update depandencies and fix warnings

* bump up version

* update xcode version

* added a logout function in AppID class which wraps AppIDAuthorizationManager's logout.

* added an example on logout in readme

* deleted empty line

* disabled a line in testRegisterOAuthClient2 where the test failed on an assertion because of a difference in map order

* added slack link

* restored deleted test line (#182)


* fixed test testRegisterOAuthClient2, it was failing because of map elements' order
  • Loading branch information
RaniAbboud authored and rotembr committed Aug 23, 2019
1 parent 122a7af commit 17c503f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 3 additions & 1 deletion IBMCloudAppIDTests/RegistrationManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ public class RegistrationManagerTests: XCTestCase {
let callback = {(error: Error?) in
XCTAssertNil(error)
XCTAssertNotNil(self.oauthManager.registrationManager?.preferenceManager.getJSONPreference(name: AppIDConstants.registrationDataPref).get())
XCTAssertEqual(self.oauthManager.registrationManager?.preferenceManager.getJSONPreference(name: AppIDConstants.registrationDataPref).get(), try? Utils.JSONStringify(["key1": "val1", "key2": "val2"] as AnyObject))

let prefrences = self.oauthManager.registrationManager?.preferenceManager.getJSONPreference(name: AppIDConstants.registrationDataPref).getAsJSON()
XCTAssertTrue(NSDictionary(dictionary: prefrences!).isEqual(to: ["key1": "val1", "key2": "val2"]))
XCTAssertEqual(self.oauthManager.registrationManager?.preferenceManager.getStringPreference(name: AppIDConstants.tenantPrefName).get(), "tenant1")

expectation1.fulfill()
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ This API can be used only when the user is logged in using Cloud Directory ident
AppID.sharedInstance.loginWidget?.launchChangePassword(delegate: delegate())
```

### Logout

```swift
AppID.sharedInstance.logout()
```

### User Profile

Using the App ID UserProfileManager, you are able to create, read, and delate attributes in a user's profile as well as retrieve additional info about a user.
Expand Down Expand Up @@ -283,6 +289,9 @@ In a rare case your application requires refreshing App ID tokens while running
AppID.secAttrAccess = .accessibleAlways
```

## Got Questions?
Join us on [Slack](https://www.ibm.com/cloud/blog/announcements/get-help-with-ibm-cloud-app-id-related-questions-on-slack) and chat with our dev team.

## License
This package contains code licensed under the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 and may also view the License in the LICENSE file within this package.

Expand Down
9 changes: 6 additions & 3 deletions Source/IBMCloudAppID/api/AppID.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,13 @@ public class AppID {
password: password, tokenResponseDelegate: tokenResponseDelegate)
}



public func application(_ application: UIApplication, open url: URL, options :[UIApplicationOpenURLOptionsKey: Any]) -> Bool {
public func application(_ application: UIApplication, open url: URL, options :[UIApplicationOpenURLOptionsKey: Any]) -> Bool {
return (self.oauthManager?.authorizationManager?.application(application, open: url, options: options))!
}

public func logout() {
let appIDAuthorizationManager = AppIDAuthorizationManager(appid: self)
appIDAuthorizationManager.logout()
}

}

0 comments on commit 17c503f

Please sign in to comment.