Skip to content

Commit

Permalink
Development (#176)
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
  • Loading branch information
AviDavidov86 authored and rotembr committed Jul 7, 2019
1 parent 90e8ddc commit 122a7af
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,7 +1,7 @@
language: objective-c
matrix:
include:
- osx_image: xcode10
- osx_image: xcode10.2
install:
- gem install jazzy
- gem install slather -v 2.4.5
Expand Down
2 changes: 1 addition & 1 deletion IBMCloudAppID.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "IBMCloudAppID"
s.version = '6.0.0'
s.version = '6.0.1'
s.summary = "AppID Swift SDK"
s.homepage = "https://github.com/ibm-cloud-security/appid-clientsdk-swift"
s.license = 'Apache License, Version 2.0'
Expand Down
8 changes: 4 additions & 4 deletions IBMCloudAppID.xcodeproj/project.pbxproj
Expand Up @@ -15,7 +15,7 @@
6749E62C81CCD62984862D58 /* Pods_IBMCloudAppID.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B1AE9343AB77B8B9C396E21 /* Pods_IBMCloudAppID.framework */; };
9539BBDF532A13A970EB051F /* Pods_IBMCloudAppIDTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB32128A91C6C77CEBDAC128 /* Pods_IBMCloudAppIDTests.framework */; };
BDC0D53F1E5EF68300444F9E /* UserProfileManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDC0D53E1E5EF68300444F9E /* UserProfileManagerImpl.swift */; };
BDF5878B1E65736B00393C0C /* (null) in Sources */ = {isa = PBXBuildFile; };
BDF5878B1E65736B00393C0C /* BuildFile in Sources */ = {isa = PBXBuildFile; };
BDF5878F1E66C55A00393C0C /* UserProfileTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDF5878E1E66C55A00393C0C /* UserProfileTests.swift */; };
EF3B3BE21E55C4E900DFFF13 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF3B3BE11E55C4E900DFFF13 /* AppDelegate.swift */; };
EF3B3BE41E55C4E900DFFF13 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF3B3BE31E55C4E900DFFF13 /* ViewController.swift */; };
Expand Down Expand Up @@ -555,7 +555,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-IBMCloudAppIDTests/Pods-IBMCloudAppIDTests-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-IBMCloudAppIDTests/Pods-IBMCloudAppIDTests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/BMSAnalyticsAPI/BMSAnalyticsAPI.framework",
"${BUILT_PRODUCTS_DIR}/BMSCore/BMSCore.framework",
"${BUILT_PRODUCTS_DIR}/JOSESwift/JOSESwift.framework",
Expand All @@ -568,7 +568,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-IBMCloudAppIDTests/Pods-IBMCloudAppIDTests-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-IBMCloudAppIDTests/Pods-IBMCloudAppIDTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -632,7 +632,7 @@
EF4994811E55F7BE008ACC27 /* SecurityUtilsTests.swift in Sources */,
EF4994821E55F7BE008ACC27 /* AppIDTestConstants.swift in Sources */,
EF4994831E55F7BE008ACC27 /* AppIDTests.swift in Sources */,
BDF5878B1E65736B00393C0C /* (null) in Sources */,
BDF5878B1E65736B00393C0C /* BuildFile in Sources */,
EF4994841E55F7BE008ACC27 /* AuthorizationHeaderHelperTests.swift in Sources */,
EF4994861E55F7BE008ACC27 /* PreferencesTests.swift in Sources */,
EF4994871E55F7BE008ACC27 /* TokenManagerTests.swift in Sources */,
Expand Down
4 changes: 2 additions & 2 deletions Podfile
Expand Up @@ -2,8 +2,8 @@ use_frameworks!

def shared_pods
platform :ios, '10.0'
pod 'BMSCore', '~> 2.3.1'
pod 'JOSESwift', '~> 1.1.0'
pod 'BMSCore', '~> 2.4.0'
pod 'JOSESwift', '~> 1.8.0'
end

target 'IBMCloudAppID' do
Expand Down
4 changes: 2 additions & 2 deletions Source/IBMCloudAppID/api/AppID.swift
Expand Up @@ -76,12 +76,12 @@ public class AppID {
tokenResponseDelegate: tokenResponseDelegate)
}

@available(*, deprecated: 3.0, renamed: "signinAnonymously")
@available(swift, deprecated: 3.0, renamed: "signinAnonymously")
public func loginAnonymously(accessTokenString:String? = nil, allowCreateNewAnonymousUsers: Bool = true, authorizationDelegate:AuthorizationDelegate) {
self.signinAnonymously(accessTokenString: accessTokenString, allowCreateNewAnonymousUsers: allowCreateNewAnonymousUsers, authorizationDelegate: authorizationDelegate)
}

@available(*, deprecated: 3.0, renamed: "signinWithResourceOwnerPassword")
@available(swift, deprecated: 3.0, renamed: "signinWithResourceOwnerPassword")
public func obtainTokensWithROP(_ accessTokenString:String? = nil, username: String, password: String, tokenResponseDelegate:TokenResponseDelegate) {
self.signinWithResourceOwnerPassword(accessTokenString, username: username,
password: password, tokenResponseDelegate: tokenResponseDelegate)
Expand Down
2 changes: 1 addition & 1 deletion Source/IBMCloudAppID/internal/RegistrationManager.swift
Expand Up @@ -48,7 +48,7 @@ internal class RegistrationManager {

internal func privateKeyExist() -> Bool {
do {
try SecurityUtils.getKeyRefFromKeyChain(AppIDConstants.privateKeyIdentifier)
try _ = SecurityUtils.getKeyRefFromKeyChain(AppIDConstants.privateKeyIdentifier)
return true
} catch {
return false
Expand Down
3 changes: 2 additions & 1 deletion Source/IBMCloudAppID/internal/TokenManager.swift
Expand Up @@ -225,7 +225,8 @@ internal class TokenManager {

public func validateToken(token: Token, key: SecKey, tokenResponseDelegate: TokenResponseDelegate, callback: @escaping () -> Void ) {

guard let jws = try? JWS(compactSerialization: token.raw), let _ = try? jws.validate(with: key),
let verifier = Verifier(verifyingAlgorithm: .RS256, publicKey: key)!
guard let jws = try? JWS(compactSerialization: token.raw), let _ = try? jws.validate(using: verifier),
let clientId = registrationManager.getRegistrationDataString(name: AppIDConstants.client_id_String) else {
tokenResponseDelegate.onAuthorizationFailure(error: .authorizationFailure("Token verification failed"))
return
Expand Down

0 comments on commit 122a7af

Please sign in to comment.