You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@milagro.apache.org by sa...@apache.org on 2016/09/17 13:05:02 UTC

[01/11] incubator-milagro-mfa-sdk-ios git commit: Add ListUsers per backend and ListBackends methods

Repository: incubator-milagro-mfa-sdk-ios
Updated Branches:
  refs/heads/master 4d1ed10b9 -> 4b4c745b4


Add ListUsers per backend and ListBackends methods


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/commit/c151174d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/tree/c151174d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/diff/c151174d

Branch: refs/heads/master
Commit: c151174d64506fdedb07c61af88cfefb3278729e
Parents: 4d1ed10
Author: georgi.georgiev <ge...@certivox.com>
Authored: Thu Mar 31 15:10:02 2016 +0300
Committer: georgi.georgiev <ge...@certivox.com>
Committed: Thu Mar 31 15:10:02 2016 +0300

----------------------------------------------------------------------
 mpin-sdk-core |  2 +-
 src/MPin.h    |  3 +++
 src/MPin.mm   | 22 ++++++++++++++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/c151174d/mpin-sdk-core
----------------------------------------------------------------------
diff --git a/mpin-sdk-core b/mpin-sdk-core
index fc0f623..0c54c01 160000
--- a/mpin-sdk-core
+++ b/mpin-sdk-core
@@ -1 +1 @@
-Subproject commit fc0f623294108141b0053092578116d3f5e9689d
+Subproject commit 0c54c01e71f33438e4aba6c6f329e8f423087934

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/c151174d/src/MPin.h
----------------------------------------------------------------------
diff --git a/src/MPin.h b/src/MPin.h
index 9e4104e..6298b58 100644
--- a/src/MPin.h
+++ b/src/MPin.h
@@ -55,6 +55,9 @@
 + (Boolean)CanLogout:(const id<IUser>)user;
 
 + (NSMutableArray*)listUsers;
++ (NSMutableArray*) listUsers:( NSString *) backendURL;
++ (NSMutableArray*) listBackends;
+
 + ( id<IUser> ) getIUserById:(NSString *) userId;
 + (void) DeleteUser:(const id<IUser>)user;
 

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/c151174d/src/MPin.mm
----------------------------------------------------------------------
diff --git a/src/MPin.mm b/src/MPin.mm
index 3a50651..78d6a04 100644
--- a/src/MPin.mm
+++ b/src/MPin.mm
@@ -248,4 +248,26 @@ typedef sdk_non_tee::Context Context;
     return nil;
 }
 
++ (NSMutableArray*) listUsers:( NSString *) backendURL {
+    if (backendURL == nil || backendURL.length == 0 ) return nil;
+    
+    NSMutableArray * users = [NSMutableArray array];
+    std::vector<UserPtr> vUsers;
+    mpin.ListUsers(vUsers, [backendURL UTF8String]);
+    for (int i = 0; i<vUsers.size(); i++) {
+        [users addObject:[[User alloc] initWith:vUsers[i]]];
+    }
+    return users;
+}
+
++ (NSMutableArray*) listBackends {
+    NSMutableArray * backends = [NSMutableArray array];
+    std::vector<String> vBackends;
+    mpin.ListBackends(vBackends);
+    for (int i = 0; i<vBackends.size(); i++) {
+        [backends addObject:[NSString stringWithUTF8String:vBackends[i].c_str()]];
+    }
+    return backends;
+}
+
 @end


[02/11] incubator-milagro-mfa-sdk-ios git commit: Merge pull request #7 in MM/mpin-sdk-ios from update to master

Posted by sa...@apache.org.
Merge pull request #7 in MM/mpin-sdk-ios from update to master

* commit 'c151174d64506fdedb07c61af88cfefb3278729e':
  Add ListUsers per backend and ListBackends methods


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/commit/7e9bbd31
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/tree/7e9bbd31
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/diff/7e9bbd31

Branch: refs/heads/master
Commit: 7e9bbd31bd00e2103b27f6f9c323389267cf0af9
Parents: 4d1ed10 c151174
Author: Georgi Georgiev <ge...@certivox.com>
Authored: Thu Mar 31 14:12:33 2016 +0200
Committer: Georgi Georgiev <ge...@certivox.com>
Committed: Thu Mar 31 14:12:33 2016 +0200

----------------------------------------------------------------------
 mpin-sdk-core |  2 +-
 src/MPin.h    |  3 +++
 src/MPin.mm   | 22 ++++++++++++++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[04/11] incubator-milagro-mfa-sdk-ios git commit: Implement GetSessionId and Delete User

Posted by sa...@apache.org.
Implement GetSessionId and Delete User


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/commit/d335af0f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/tree/d335af0f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/diff/d335af0f

Branch: refs/heads/master
Commit: d335af0fd3752326091881ff5c044544accf681e
Parents: df94497
Author: georgi.georgiev <ge...@certivox.com>
Authored: Tue Apr 26 15:28:35 2016 +0300
Committer: georgi.georgiev <ge...@certivox.com>
Committed: Thu Apr 28 09:44:42 2016 +0300

----------------------------------------------------------------------
 MPinSDK/MPinSDK.xcodeproj/project.pbxproj |  6 ++++++
 MPinSDK/MPinSDK/SessionDetails.h          | 16 +++++++++++++++
 MPinSDK/MPinSDK/SessionDetails.m          | 23 ++++++++++++++++++++++
 mpin-sdk-core                             |  2 +-
 src/MPin.h                                |  3 ++-
 src/MPin.mm                               | 27 ++++++++++++++++----------
 6 files changed, 65 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/d335af0f/MPinSDK/MPinSDK.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/MPinSDK/MPinSDK.xcodeproj/project.pbxproj b/MPinSDK/MPinSDK.xcodeproj/project.pbxproj
index f78ab3f..98bba91 100644
--- a/MPinSDK/MPinSDK.xcodeproj/project.pbxproj
+++ b/MPinSDK/MPinSDK.xcodeproj/project.pbxproj
@@ -8,6 +8,7 @@
 
 /* Begin PBXBuildFile section */
 		FE49FF9C1A1A3C2D000030A4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FE49FF9B1A1A3C2D000030A4 /* Foundation.framework */; };
+		FE7C75FC1CCF8D5B003AEB27 /* SessionDetails.m in Sources */ = {isa = PBXBuildFile; fileRef = FE7C75FB1CCF8D5B003AEB27 /* SessionDetails.m */; };
 		FE991F061C5F66540014F23E /* Context.mm in Sources */ = {isa = PBXBuildFile; fileRef = FE991EF61C5F66540014F23E /* Context.mm */; };
 		FE991F071C5F66540014F23E /* HTTPConnector.mm in Sources */ = {isa = PBXBuildFile; fileRef = FE991EFA1C5F66540014F23E /* HTTPConnector.mm */; };
 		FE991F081C5F66540014F23E /* MPin.mm in Sources */ = {isa = PBXBuildFile; fileRef = FE991EFD1C5F66540014F23E /* MPin.mm */; };
@@ -64,6 +65,8 @@
 		FE49FF9B1A1A3C2D000030A4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
 		FE49FF9F1A1A3C2D000030A4 /* MPinSDK-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MPinSDK-Prefix.pch"; sourceTree = "<group>"; };
 		FE49FFAC1A1A3C2D000030A4 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
+		FE7C75FA1CCF8D5B003AEB27 /* SessionDetails.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SessionDetails.h; sourceTree = "<group>"; };
+		FE7C75FB1CCF8D5B003AEB27 /* SessionDetails.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SessionDetails.m; sourceTree = "<group>"; };
 		FE991EF51C5F66540014F23E /* Context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Context.h; path = ../../src/Context.h; sourceTree = "<group>"; };
 		FE991EF61C5F66540014F23E /* Context.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = Context.mm; path = ../../src/Context.mm; sourceTree = "<group>"; };
 		FE991EF71C5F66540014F23E /* def.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = def.h; path = ../../src/def.h; sourceTree = "<group>"; };
@@ -178,6 +181,8 @@
 				FE991EFB1C5F66540014F23E /* IUser.h */,
 				FE991EFC1C5F66540014F23E /* MPin.h */,
 				FE991EFD1C5F66540014F23E /* MPin.mm */,
+				FE7C75FA1CCF8D5B003AEB27 /* SessionDetails.h */,
+				FE7C75FB1CCF8D5B003AEB27 /* SessionDetails.m */,
 				FE991EFE1C5F66540014F23E /* MpinStatus.h */,
 				FE991EFF1C5F66540014F23E /* MpinStatus.m */,
 				FE991F001C5F66540014F23E /* OTP.h */,
@@ -337,6 +342,7 @@
 				FE991F0A1C5F66540014F23E /* OTP.m in Sources */,
 				FE991F071C5F66540014F23E /* HTTPConnector.mm in Sources */,
 				FED0EE121C68C984001AB531 /* pair.c in Sources */,
+				FE7C75FC1CCF8D5B003AEB27 /* SessionDetails.m in Sources */,
 				FED0EE131C68C984001AB531 /* rand.c in Sources */,
 				FED0EE061C68C984001AB531 /* big.c in Sources */,
 				FED0EE141C68C984001AB531 /* rom.c in Sources */,

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/d335af0f/MPinSDK/MPinSDK/SessionDetails.h
----------------------------------------------------------------------
diff --git a/MPinSDK/MPinSDK/SessionDetails.h b/MPinSDK/MPinSDK/SessionDetails.h
new file mode 100644
index 0000000..f19b30b
--- /dev/null
+++ b/MPinSDK/MPinSDK/SessionDetails.h
@@ -0,0 +1,16 @@
+//
+//  SessionDetails.h
+//  MPinSDK
+//
+//  Created by Georgi Georgiev on 4/26/16.
+//  Copyright � 2016 Certivox. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface SessionDetails : NSObject
+@property (nonatomic, retain) NSString * prerollId;
+@property (nonatomic, retain) NSString * appName;
+@property (nonatomic, retain) NSString * appIconUrl;
+- (id) initWith:(NSString * ) prerollId appName:(NSString *) appName appIconUrl:(NSString *) appIconUrl;
+@end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/d335af0f/MPinSDK/MPinSDK/SessionDetails.m
----------------------------------------------------------------------
diff --git a/MPinSDK/MPinSDK/SessionDetails.m b/MPinSDK/MPinSDK/SessionDetails.m
new file mode 100644
index 0000000..b5cc0f6
--- /dev/null
+++ b/MPinSDK/MPinSDK/SessionDetails.m
@@ -0,0 +1,23 @@
+//
+//  SessionDetails.m
+//  MPinSDK
+//
+//  Created by Georgi Georgiev on 4/26/16.
+//  Copyright � 2016 Certivox. All rights reserved.
+//
+
+#import "SessionDetails.h"
+
+@implementation SessionDetails
+
+- (id) initWith:(NSString * ) prerollId appName:(NSString *) appName appIconUrl:(NSString *) appIconUrl {
+    self = [super init];
+    if (self) {
+        self.prerollId = prerollId;
+        self.appName = appName;
+        self.appIconUrl = appIconUrl;
+    }
+    return self;
+}
+
+@end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/d335af0f/mpin-sdk-core
----------------------------------------------------------------------
diff --git a/mpin-sdk-core b/mpin-sdk-core
index acd0530..ac6536c 160000
--- a/mpin-sdk-core
+++ b/mpin-sdk-core
@@ -1 +1 @@
-Subproject commit acd0530bc597f27c93ebeda3059107f553b955a0
+Subproject commit ac6536c47bbb123fcafa83ad3dad034b60a92a3c

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/d335af0f/src/MPin.h
----------------------------------------------------------------------
diff --git a/src/MPin.h b/src/MPin.h
index 0283959..e932d5d 100644
--- a/src/MPin.h
+++ b/src/MPin.h
@@ -21,6 +21,7 @@
 #import "IUser.h"
 #import "MpinStatus.h"
 #import "OTP.h"
+#import "SessionDetails.h"
 
 @interface MPin : NSObject
 
@@ -58,7 +59,7 @@
 + (NSMutableArray*)listUsers;
 + (NSMutableArray*) listUsers:( NSString *) backendURL;
 + (NSMutableArray*) listBackends;
-+ (NSString *) getPrerollUserId:(NSString *) accessCode;
++ (SessionDetails *) GetSessionDetails:(NSString *) accessCode;
 
 + ( id<IUser> ) getIUserById:(NSString *) userId;
 + (void) DeleteUser:(const id<IUser>)user;

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/d335af0f/src/MPin.mm
----------------------------------------------------------------------
diff --git a/src/MPin.mm b/src/MPin.mm
index 328b148..28225d4 100644
--- a/src/MPin.mm
+++ b/src/MPin.mm
@@ -98,12 +98,6 @@ typedef sdk_non_tee::Context Context;
     return [[User alloc] initWith:userPtr];
 }
 
-+(void) DeleteUser:(const id<IUser>) user {
-    [lock lock];
-    mpin.DeleteUser([((User *) user) getUserPtr]);
-    [lock unlock];
-}
-
 + (MpinStatus*) StartRegistration:(const  id<IUser>) user {
     return [MPin StartRegistration:user activateCode:@"" userData:@""];
 }
@@ -242,11 +236,18 @@ typedef sdk_non_tee::Context Context;
     return users;
 }
 
-+ (NSString *) getPrerollUserId:(NSString *) accessCode {
++ (SessionDetails *) GetSessionDetails:(NSString *) accessCode {
     [lock lock];
-    String value = mpin.GetPrerollUserId([accessCode UTF8String]);
+    MPinSDK::SessionDetails sd;
+    Status s = mpin.GetSessionDetails([accessCode UTF8String] , sd);
     [lock unlock];
-    return [NSString stringWithUTF8String:value.c_str()];
+    
+    if (s.GetStatusCode() != Status::Code::OK)
+        return nil;
+
+    return  [[SessionDetails alloc] initWith:[NSString stringWithUTF8String:sd.prerollId.c_str()]
+                                      appName:[NSString stringWithUTF8String:sd.appName.c_str()]
+                                   appIconUrl:[NSString stringWithUTF8String:sd.appIconUrl.c_str()]];
 }
 
 + ( id<IUser> ) getIUserById:(NSString *) userId {
@@ -284,4 +285,10 @@ typedef sdk_non_tee::Context Context;
     return backends;
 }
 
-@end
++ (void) DeleteUser:(const id<IUser>) user {
+    [lock lock];
+    mpin.DeleteUser([((User *) user) getUserPtr]);
+    [lock unlock];
+}
+
+@end
\ No newline at end of file


[08/11] incubator-milagro-mfa-sdk-ios git commit: Update sdk-core

Posted by sa...@apache.org.
Update sdk-core


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/commit/64e5af6c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/tree/64e5af6c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/diff/64e5af6c

Branch: refs/heads/master
Commit: 64e5af6ce160dfd9558b9acca80fd6b3437e0a85
Parents: 4909c03
Author: georgi.georgiev <ge...@certivox.com>
Authored: Tue Sep 13 12:03:27 2016 +0300
Committer: georgi.georgiev <ge...@certivox.com>
Committed: Tue Sep 13 12:03:27 2016 +0300

----------------------------------------------------------------------
 mpin-sdk-core | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/64e5af6c/mpin-sdk-core
----------------------------------------------------------------------
diff --git a/mpin-sdk-core b/mpin-sdk-core
index ac6536c..e631fb2 160000
--- a/mpin-sdk-core
+++ b/mpin-sdk-core
@@ -1 +1 @@
-Subproject commit ac6536c47bbb123fcafa83ad3dad034b60a92a3c
+Subproject commit e631fb2db35485114e6628abee12a28989e35cff


[11/11] incubator-milagro-mfa-sdk-ios git commit: Merge pull request #11 in MM/mpin-sdk-ios from upd-sdk to master

Posted by sa...@apache.org.
Merge pull request #11 in MM/mpin-sdk-ios from upd-sdk to master

* commit '0d0cfa885e55dfdc6b31abe493034cd154480a08':
  Update sdk-core submodule , moving SessionDetails to src folder, code styling


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/commit/4b4c745b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/tree/4b4c745b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/diff/4b4c745b

Branch: refs/heads/master
Commit: 4b4c745b491cd592f99f0061c9f68f490bb3de47
Parents: 5a0176e 0d0cfa8
Author: Simeon Aladjem <si...@certivox.com>
Authored: Sat Sep 17 15:00:11 2016 +0200
Committer: Simeon Aladjem <si...@certivox.com>
Committed: Sat Sep 17 15:00:11 2016 +0200

----------------------------------------------------------------------
 MPinSDK/MPinSDK.xcodeproj/project.pbxproj | 12 +++----
 MPinSDK/MPinSDK/SessionDetails.h          | 16 ----------
 MPinSDK/MPinSDK/SessionDetails.m          | 23 --------------
 mpin-sdk-core                             |  2 +-
 src/MPin.h                                | 44 +++++++++++++-------------
 src/MpinStatus.h                          |  4 ++-
 src/MpinStatus.m                          |  6 ++++
 src/SessionDetails.h                      | 16 ++++++++++
 src/SessionDetails.m                      | 23 ++++++++++++++
 9 files changed, 77 insertions(+), 69 deletions(-)
----------------------------------------------------------------------



[06/11] incubator-milagro-mfa-sdk-ios git commit: Update submodule to Milagro

Posted by sa...@apache.org.
Update submodule to Milagro


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/commit/1c4b7163
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/tree/1c4b7163
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/diff/1c4b7163

Branch: refs/heads/master
Commit: 1c4b71636d3b7589d420cc65ea8a290f20ac9869
Parents: 53f1ebb
Author: Simeon Aladjem <si...@miracl.com>
Authored: Sat Sep 10 17:18:27 2016 +0300
Committer: Simeon Aladjem <si...@miracl.com>
Committed: Sat Sep 10 17:18:27 2016 +0300

----------------------------------------------------------------------
 .gitmodules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/1c4b7163/.gitmodules
----------------------------------------------------------------------
diff --git a/.gitmodules b/.gitmodules
index ad33421..dccdf96 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,3 @@
 [submodule "mpin-sdk-core"]
 	path = mpin-sdk-core
-	url = ../mpin-sdk-core.git
+	url = https://github.com/apache/incubator-milagro-mfa-sdk-core.git


[09/11] incubator-milagro-mfa-sdk-ios git commit: Add documentation

Posted by sa...@apache.org.
Add documentation


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/commit/5a0176ef
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/tree/5a0176ef
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/diff/5a0176ef

Branch: refs/heads/master
Commit: 5a0176efb79b4e571fe30c13876541ebdde55c09
Parents: 64e5af6
Author: Simeon Aladjem <si...@miracl.com>
Authored: Sat Sep 17 14:33:29 2016 +0300
Committer: Simeon Aladjem <si...@miracl.com>
Committed: Sat Sep 17 14:33:29 2016 +0300

----------------------------------------------------------------------
 README.md | 242 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 237 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/5a0176ef/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 5219698..2a7a9a0 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,248 @@
-# iOS M-Pin SDK
+# Milagro Mobile SDK for iOS
 
-## Building the M-Pin Mobile SDK for iOS
+## Building the Milagro Mobile SDK for iOS
 
 ### Prerequisites
 
 1. Download and install Xcode 7.1 or higher
 2. Download or Clone the project and its submodule
 
-### Building the M-Pin Mobile SDK
+### Building the Milagro Mobile SDK
 
-1. Navigate to `<mpin-sdk-ios>`
+1. Navigate to `<milagro-sdk-ios>`
 2. Open `MPinSDK/MPinSDK.xcodeproj`
 3. Select *Product->Build* from the Xcode menu.
 
-For further details, see [M-Pin Mobile SDK for iOS Online Help](http://docs.miracl.com/m-pin-mobile-sdk-for-ios) 
\ No newline at end of file
+For further details, see [Milagro Mobile SDK for iOS Documentation](http://docs.milagro.io/en/mfa/mobile-sdk-ios/milagro-mfa-mobile-sdk-developer-guide.html)
+
+## SDK API for iOS (`MPin` class)
+
+The iOS SDK API is used by iOS application developers for integrating with the SDK. The API resembles the SDK Core layer, but it exposes to the Application layer, only those methods that the application needs. Most of the methods return the `MpinStatus` object which is defined as follows:
+
+```objective-c
+typedef NS_ENUM(NSInteger, MPinStatus) {
+    OK = 0,
+    PIN_INPUT_CANCELED,      // Local error, returned when user cancels entering a pin
+    CRYPTO_ERROR,            // Local error in crypto functions
+    STORAGE_ERROR,           // Local storage related error
+    NETWORK_ERROR,           // Local error - cannot connect to remote server (no internet, or invalid server/port)
+    RESPONSE_PARSE_ERROR,    // Local error - cannot parse json response from remote server (invalid json or unexpected json structure)
+    FLOW_ERROR,              // Local error - improper MPinSDK class usage
+    IDENTITY_NOT_AUTHORIZED, // Remote error - the remote server refuses user registration
+    IDENTITY_NOT_VERIFIED,   // Remote error - the remote server refuses user registration because identity is not verified
+    REQUEST_EXPIRED,         // Remote error - the register/authentication request expired
+    REVOKED,                 // Remote error - cannot get time permit (probably the user is temporary suspended)
+    INCORRECT_PIN,           // Remote error - user entered wrong pin
+    INCORRECT_ACCESS_NUMBER, // Remote/local error - wrong access number (checksum failed or RPS returned 412)
+    HTTP_SERVER_ERROR,       // Remote error, which is not one of the above - the remote server returned internal server error status (5xx)
+    HTTP_REQUEST_ERROR,      // Remote error, which is not one of the above - invalid data sent to server, the remote server returned 4xx error status
+    BAD_USER_AGENT,          // Remote error - user agent not supported
+    CLIENT_SECRET_EXPIRED    // Remote error - re-registration required because server master secret expired
+};
+
+@interface MpinStatus : NSObject
+
+@property (nonatomic, readwrite) MPinStatus status;
+@property (nonatomic, strong) NSString* errorMessage;
+
+- (instancetype)initWith: (MPinStatus)status errorMessage: (NSString*)error;
+@property (NS_NONATOMIC_IOSONLY, getter=getStatusCodeAsString, readonly, copy) NSString* statusCodeAsString;
+
+@end
+```
+
+##### `(void) initSDK;`
+This method constructs/initializes the SDK object.
+
+**Note that after this initialization the SDK will not be ready for usage until `SetBackend` is called with a valid _Server URL_.**
+
+##### `(MpinStatus*) TestBackend: (const NSString*) url;`
+##### `(MpinStatus*) TestBackend: (const NSString*) url rpsPrefix: (const NSString*) rpsPrefix;`
+This method will test whether `url` is a valid back-end URL by trying to retrieve Client Settings from it.
+Optionally, a custom RPS prefix might be specified if it was customized at the back-end and is different than the default `"rps"`.
+If the back-end URL is a valid one, the method will return status `OK`.
+
+##### `(MpinStatus*) SetBackend: (const NSString*) url;`
+##### `(MpinStatus*) SetBackend: (const NSString*) url rpsPrefix: (const NSString*) rpsPrefix;`
+This method will change the currently configured back-end in the SDK.
+`url` is the new back-end URL that should be used.
+Optionally, a custom RPS prefix might be specified if it was customized at the back-end and is different than the default `"rps"`.
+If successful, the method will return status `OK`.
+
+##### `(id<IUser>) MakeNewUser: (const NSString*) identity;`
+##### `(id<IUser>) MakeNewUser: (const NSString*) identity deviceName: (const NSString*) devName;`
+This method creates a new user object. The user object represents an end-user of the Milagro authentication.
+The user has its own unique identity, which is passed as the `identity` parameter to this method.
+Additionally, an optional `deviceName` might be specified. The _Device Name_ is passed to the RPA, which might store it and use it later to determine which _M-Pin ID_ is associated with this device.
+The returned value is a newly created user instance. The User class itself looks like this:
+```objective-c
+typedef NS_ENUM(NSInteger, UserState)
+{
+    INVALID,
+    STARTED_REGISTRATION,
+    REGISTERED,
+    ACTIVATED,
+    BLOCKED
+};
+
+@protocol IUser <NSObject>
+-(NSString*) getIdentity;
+-(UserState) getState;
+@end
+```
+
+The newly created user is in the `INVALID` user state.
+
+##### `(void) DeleteUser: (const id<IUser>) user;`
+This method deletes a user from the users list that the SDK maintains.
+All the user data including its _M-Pin ID_, its state and _M-Pin Token_ will be deleted.
+A new user with the same identity can be created later with the `MakeNewUser` method.
+
+##### `(NSMutableArray*) listUsers;`
+This method populates the provided list with all the users that are associated with the currently set backend.
+Different users might be in different states, reflecting their registration status.
+The method will return status `OK` on success and `FLOW_ERROR` if no backend is set through the `Init()` or `SetBackend()` methods.
+
+##### `(NSMutableArray*) listUsers: (NSString*) backendURL`
+This method returns a list with all the users that are associated with the provided `backendURL`.
+Different users might be in different states, reflecting their registration status.
+
+##### `(NSMutableArray*) listBackends`
+This method will return a list with all the backends known to the SDK.
+
+##### `(SessionDetails*) GetSessionDetails: (NSString*) accessCode;`
+This method could be optionally used to retrieve details regarding a browser session when the SDK is used to authenticate users to an online service, such as the _MIRACL MFA Platform_.
+In this case an `accessCode` is transferred to the mobile device out-of-band e.g. via scanning a graphical code. The code is then provided to this method to get the session details.
+This method will also notify the backend that the `accessCode` was retrieved from the browser session.
+The returned `SessionDetails` look as follows:
+```objective-c
+@interface SessionDetails : NSObject
+@property (nonatomic, retain) NSString* prerollId;
+@property (nonatomic, retain) NSString* appName;
+@property (nonatomic, retain) NSString* appIconUrl;
+- (id) initWith: (NSString*) prerollId appName: (NSString*) appName appIconUrl: (NSString*) appIconUrl;
+@end
+```
+During the online browser session an optional user identity might be provided meaning that this is the user that wants to register/authenticate to the online service.
+* The `prerollId` will carry that user ID, or it will be empty if no such ID was provided.
+* `appName` is the name of the web application to which the service will authenticate the user.
+* `appIconUrl` is the URL from which the icon for web application could be downloaded.
+
+##### `(MpinStatus*) StartRegistration: (const id<IUser>) user;`
+##### `(MpinStatus*) StartRegistration: (const id<IUser>) user userData: (NSString*) userData;`
+##### `(MpinStatus*) StartRegistration: (const id<IUser>) user activateCode: (NSString*) activateCode;`
+##### `(MpinStatus*) StartRegistration: (const id<IUser>) user activateCode: (NSString*) activateCode userData: (NSString*) userData;`
+This method initializes the registration for a user that has already been created. The SDK starts the Milagro Setup flow, sending the necessary requests to the back-end service.
+The State of the user instance will change to `STARTED_REGISTRATION`. The status will indicate whether the operation was successful or not.
+During this call, an _M-Pin ID_ for the end-user will be issued by the RPS and stored within the user object.
+The RPA could also start a user identity verification procedure, by sending a verification e-mail.
+
+The optional `activateCode` parameter might be provided if the registration process requires such.
+In cases when the user verification is done through a _One-Time-Code_ (OTC) or through an SMS that carries such code, this OTC should be passed as the `activateCode` parameter.
+In those cases, the identity verification should be completed instantly and the User State will be set to `ACTIVATED`.
+ 
+Optionally, the application might pass additional `userData` which might help the RPA to verify the user identity.
+The RPA might decide to verify the identity without starting a verification process. In this case, the status of the call will still be `OK`, but the User State will be set to `ACTIVATED`.
+
+##### `(MpinStatus*) RestartRegistration: (const id<IUser>) user;`
+##### `(MpinStatus*) RestartRegistration: (const id<IUser>) user userData: (const NSString*) userData;`
+This method re-initializes the registration process for a user, where registration has already started.
+The difference between this method and `StartRegistration` is that it will not generate a new _M-Pin ID_, but will use the one that was already generated.
+Besides that, the methods follow the same procedures, such as getting the RPA to re-start the user identity verification procedure of sending a verification email to the user.
+
+The application could also pass additional `userData` to help the RPA to verify the user identity.
+The RPA might decide to verify the identity without starting a verification process. In this case, the status of the call will still be `OK`, but the User State will be set to `ACTIVATED`.
+
+##### `(MpinStatus*) ConfirmRegistration: (const id<IUser>) user;`
+##### `(MpinStatus*) ConfirmRegistration: (const id<IUser>) user pushNotificationIdentifier: (NSString*) pushNotificationIdentifier;`
+This method allows the application to check whether the user identity verification process has been finalized or not.
+The provided `user` object is expected to be either in the `STARTED_REGISTRATION` state or in the `ACTIVATED` state.
+The latter is possible if the RPA activated the user immediately with the call to `StartRegistration` and no verification process was started.
+During the call to `ConfirmRegistration` the SDK will make an attempt to retrieve _Client Key_ for the user.
+This attempt will succeed if the user has already been verified/activated but will fail otherwise.
+The method will return status `OK` if the Client Key has been successfully retrieved and `IDENTITY_NOT_VERIFIED` if the identity has not been verified yet.
+If the method has succeeded, the application is expected to get the desired PIN/secret from the end-user and then call `FinishRegistration`, and provide the PIN.
+
+**Note** Using the optional parameter `pushNotificationIdentifier`, the application can provide a platform specific identifier for sending _Push Messages_ to the device. Such push messages might be utilized as an alternative to the _Access Number/Code_, as part of the authentication flow.
+
+##### `(MpinStatus*) FinishRegistration: (const id<IUser>) user pin: (NSString*) pin;`
+This method finalizes the user registration process.
+It extracts the _M-Pin Token_ from the _Client Key_ for the provided `pin` (secret), and then stores the token in the secure storage.
+On successful completion, the user state will be set to `REGISTERED` and the method will return status `OK`.
+
+##### `(MpinStatus*) StartAuthentication: (const id<IUser>) user;`
+##### `(MpinStatus*) StartAuthentication: (const id<IUser>) user accessCode: (NSString*) accessCode;`
+This method starts the authentication process for a given `user`.
+It attempts to retrieve the _Time Permits_ for the user, and if successful, will return status `OK`.
+If they cannot be retrieved, the method will return status `REVOKED`.
+If this method is successfully completed, the app should read the PIN/secret from the end-user and call one of the `FinishAuthentication` variants to authenticate the user.
+
+Optionally, an `accessCode` could be provided. This code is retrieved out-of-band from a browser session when the user has to be authenticated to an online service, such as the _MIRACL MFA Platform_.
+When this code is provided, the SDK will notify the service that authentication associated with the given `accessCode` has started for the provided user. 
+
+##### `(MpinStatus*) CheckAccessNumber: (NSString*) an;`
+This method is used only when a user needs to be authenticated to a remote (browser) session, using _Access Number_.
+The access numbers might have a check-sum digit in them and this check-sum needs to be verified on the client side, in order to prevent calling the back-end with non-compliant access numbers.
+The method will return status `OK` if successful, and `INCORRECT_ACCESS_NUMBER` if not successful.
+
+##### `(MpinStatus*) FinishAuthentication: (const id<IUser>) user pin: (NSString*) pin;`
+##### `(MpinStatus*) FinishAuthentication: (const id<IUser>) user pin: (NSString*) pin authResultData: (NSString**) authResultData;`
+This method performs end-user authentication where the `user` to be authenticated is passed as a parameter, along with his `pin` (secret).
+The method performs the authentication against the _Milagro MFA Server_ using the provided PIN and the stored _M-Pin Token_, and then logs into the RPA.
+The RPA responds with the authentication _User Data_ which is returned to the application through the `authResultData` parameter.
+If successful, the returned status will be `OK`, and if the authentication fails, the return status would be `INCORRECT_PIN`.
+After the 3rd (configurable in the RPS) unsuccessful authentication attempt, the method will return `INCORRECT_PIN` and the User State will be set to `BLOCKED`.
+
+##### `(MpinStatus*) FinishAuthenticationOTP: (id<IUser>) user pin: (NSString*) pin otp: (OTP**) otp;`
+This method performs end-user authentication for an OTP. The authentication process is similar to `FinishAuthentication`, but the RPA issues an OTP instead of logging the user into the application.
+The returned status is analogical to the `FinishAuthentication` method, but in addition to that, an `OTP` object is returned. The `OTP` class looks like this:
+```objective-c
+@interface OTP: NSObject
+ 
+@property (nonatomic, retain, readonly) MpinStatus* status;
+@property (nonatomic, retain, readonly) NSString* otp;
+@property (atomic, readonly) long expireTime;
+@property (atomic, readonly) int ttlSeconds;
+@property (atomic, readonly) long nowTime;
+
+- (id) initWith: (MpinStatus*) status otp: (NSString*) otp expireTime: (long) expTime ttlSeconds: (int) ttlSeconds nowTime: (long) nowTime;
+ 
+@end
+```
+* The `otp` string is the issued OTP.
+* The `expireTime` is the Milagro MFA system time when the OTP will expire.
+* The `ttlSeconds` is the expiration period in seconds.
+* The `nowTime` is the current Milagro MFA system time.
+* `status` is the status of the OTP generation. The status will be `OK` if the OTP was successfully generated, or `FLOW_ERROR` if not.
+
+**NOTE** that OTP might be generated only by RPA that supports that functionality, such as the MIRACL M-Pin SSO. Other RPA's might not support OTP generation where the `status` inside the returned `otp` instance will be `FLOW_ERROR`.
+
+##### `(MpinStatus*) FinishAuthenticationAN: (id<IUser>) user pin: (NSString*) pin accessNumber: (NSString*) an;`
+This method authenticates the end-user using an _Access Number_ (also refered as _Access Code_), provided by a PC/Browser session.
+After this authentication, the end-user can log into the PC/Browser which provided the Access Number, while the authentication itself is done on the Mobile Device.
+`an` is the Access Number from the browser session. The returned status might be:
+
+* `OK` - Successful authentication.
+* `INCORRECT_PIN` - The authentication failed because of incorrect PIN. After the 3rd (configurable in the RPS) unsuccessful authentication attempt, the method will still return `INCORRECT_PIN` but the User State will be set to `BLOCKED`.
+* `INCORRECT_ACCESS_NUMBER` - The authentication failed because of incorrect Access Number. 
+
+##### `(Boolean) CanLogout: (const id<IUser>) user;`
+This method is used after authentication with an Access Number/Code through `FinishAuthenticationAN`.
+After such an authentication, the Mobile Device can log out the end-user from the Browser session, if the RPA supports that functionality.
+This method checks whether logout information was provided by the RPA and the remote (Browser) session can be terminated from the Mobile Device.
+The method will return `TRUE` if the user can be logged-out from the remote session, and `FALSE` otherwise.
+
+##### `(Boolean) Logout: (const id<IUser>) user;`
+This method tries to log out the end-user from a remote (Browser) session after a successful authentication through `FinishAuthenticationAN`.
+Before calling this method, it is recommended to ensure that logout data was provided by the RPA and that the logout operation can be actually performed.
+The method will return `TRUE` if the logged-out request to the RPA was successful, and `FALSE` otherwise.
+
+##### `(NSString*) GetClientParam: (const NSString*) key;`
+This method returns the value for a _Client Setting_ with the given key.
+The value is returned as a string always, i.e. when a numeric or a boolean value is expected, the conversion should be handled by the application. 
+Client settings that might interest the applications are:
+* `accessNumberDigits` - The number of Access Number digits that should be entered by the user, prior to calling `FinishAuthenticationAN`.
+* `setDeviceName` - Indicator (`true/false`) whether the application should ask the user to insert a _Device Name_ and pass it to the `MakeNewUser` method.
+* `appID` - The _App ID_ used by the backend. The App ID is a unique ID assigned to each customer or application. It is a hex-encoded long numeric value. The App ID can be used only for information purposes and it does not affect the application's behavior in any way.
+
+For more information you can refer to the [SDK Core](https://github.com/apache/incubator-milagro-mfa-sdk-core)
\ No newline at end of file


[03/11] incubator-milagro-mfa-sdk-ios git commit: Implement GetPrerollUserId method , extend StartAuthentication to support AccessCode input param

Posted by sa...@apache.org.
Implement GetPrerollUserId method , extend StartAuthentication to support AccessCode input param


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/commit/df94497b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/tree/df94497b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/diff/df94497b

Branch: refs/heads/master
Commit: df94497b2d823f333ea1e7b4b7b970cbf814b9e8
Parents: 7e9bbd3
Author: georgi.georgiev <ge...@certivox.com>
Authored: Mon Apr 11 10:56:03 2016 +0300
Committer: georgi.georgiev <ge...@certivox.com>
Committed: Mon Apr 11 10:56:03 2016 +0300

----------------------------------------------------------------------
 mpin-sdk-core |  2 +-
 src/MPin.h    |  2 ++
 src/MPin.mm   | 16 +++++++++++++++-
 3 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/df94497b/mpin-sdk-core
----------------------------------------------------------------------
diff --git a/mpin-sdk-core b/mpin-sdk-core
index 0c54c01..acd0530 160000
--- a/mpin-sdk-core
+++ b/mpin-sdk-core
@@ -1 +1 @@
-Subproject commit 0c54c01e71f33438e4aba6c6f329e8f423087934
+Subproject commit acd0530bc597f27c93ebeda3059107f553b955a0

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/df94497b/src/MPin.h
----------------------------------------------------------------------
diff --git a/src/MPin.h b/src/MPin.h
index 6298b58..0283959 100644
--- a/src/MPin.h
+++ b/src/MPin.h
@@ -45,6 +45,7 @@
 + (MpinStatus*)FinishRegistration:(const id<IUser>)user pin:(NSString *) pin;
 
 + (MpinStatus*) StartAuthentication:(const id<IUser>)user;
++ (MpinStatus*) StartAuthentication:(const id<IUser>)user accessCode:(NSString *) accessCode;
 + (MpinStatus*) CheckAccessNumber:(NSString *)an;
 + (MpinStatus*)FinishAuthentication:(const id<IUser>)user pin:(NSString *) pin;
 + (MpinStatus*)FinishAuthentication:(const id<IUser>)user pin:(NSString *) pin authResultData:(NSString **)authResultData;
@@ -57,6 +58,7 @@
 + (NSMutableArray*)listUsers;
 + (NSMutableArray*) listUsers:( NSString *) backendURL;
 + (NSMutableArray*) listBackends;
++ (NSString *) getPrerollUserId:(NSString *) accessCode;
 
 + ( id<IUser> ) getIUserById:(NSString *) userId;
 + (void) DeleteUser:(const id<IUser>)user;

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/df94497b/src/MPin.mm
----------------------------------------------------------------------
diff --git a/src/MPin.mm b/src/MPin.mm
index 78d6a04..328b148 100644
--- a/src/MPin.mm
+++ b/src/MPin.mm
@@ -158,7 +158,14 @@ typedef sdk_non_tee::Context Context;
     [lock lock];
     Status s = mpin.StartAuthentication([((User *) user) getUserPtr]);
     [lock unlock];
-    return [[MpinStatus alloc] initWith:(MPinStatus)s.GetStatusCode() errorMessage:[NSString stringWithUTF8String:s.GetErrorMessage().c_str()]];;
+    return [[MpinStatus alloc] initWith:(MPinStatus)s.GetStatusCode() errorMessage:[NSString stringWithUTF8String:s.GetErrorMessage().c_str()]];
+}
+
++ (MpinStatus*) StartAuthentication:(const id<IUser>)user accessCode:(NSString *) accessCode {
+    [lock lock];
+    Status s = mpin.StartAuthentication([((User *) user) getUserPtr], [accessCode UTF8String]);
+    [lock unlock];
+    return [[MpinStatus alloc] initWith:(MPinStatus)s.GetStatusCode() errorMessage:[NSString stringWithUTF8String:s.GetErrorMessage().c_str()]];
 }
 
 + (MpinStatus*) CheckAccessNumber:(NSString *)an {
@@ -235,6 +242,13 @@ typedef sdk_non_tee::Context Context;
     return users;
 }
 
++ (NSString *) getPrerollUserId:(NSString *) accessCode {
+    [lock lock];
+    String value = mpin.GetPrerollUserId([accessCode UTF8String]);
+    [lock unlock];
+    return [NSString stringWithUTF8String:value.c_str()];
+}
+
 + ( id<IUser> ) getIUserById:(NSString *) userId {
     if( userId == nil ) return nil;
     if ([@"" isEqualToString:userId]) return nil;


[05/11] incubator-milagro-mfa-sdk-ios git commit: add User-Agent field to http header

Posted by sa...@apache.org.
add User-Agent field to http header


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/commit/53f1ebbb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/tree/53f1ebbb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/diff/53f1ebbb

Branch: refs/heads/master
Commit: 53f1ebbb5223d0ef00d0800c36b25bedec35dc5e
Parents: d335af0
Author: georgi.georgiev <ge...@certivox.com>
Authored: Fri Sep 2 14:46:00 2016 +0300
Committer: georgi.georgiev <ge...@certivox.com>
Committed: Fri Sep 2 14:46:00 2016 +0300

----------------------------------------------------------------------
 src/HTTPConnector.mm | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/53f1ebbb/src/HTTPConnector.mm
----------------------------------------------------------------------
diff --git a/src/HTTPConnector.mm b/src/HTTPConnector.mm
index 21e7873..7acb724 100644
--- a/src/HTTPConnector.mm
+++ b/src/HTTPConnector.mm
@@ -19,6 +19,7 @@
 
 #include "HTTPConnector.h"
 #import "MPin.h"
+#import <UIKit/UIKit.h>
 
 static NSInteger constIntTimeoutInterval = 30;
 static NSString *constStrConnectionTimeoutNotification = @"ConnectionTimeoutNotification";
@@ -101,6 +102,17 @@ namespace net {
         
         [request addValue:@"ios" forHTTPHeaderField:@"X-MIRACL-OS-Class"];
         
+        NSDictionary *dictInfo = [[NSBundle mainBundle] infoDictionary];
+        NSString *strBundleID       = dictInfo[@"CFBundleIdentifier"];
+        NSString *strAppVersion     = dictInfo[@"CFBundleShortVersionString"];
+        NSString *strOSVersion      = [[UIDevice currentDevice] systemVersion];
+        NSString *strBuildNumber    = dictInfo[@"CFBundleVersion"];
+        
+        NSString *strUserAgent = [NSString stringWithFormat:@"%@/%@ (ios/%@) build/%@",strBundleID,strAppVersion,strOSVersion, strBuildNumber];
+        
+        [request setValue:strUserAgent forHTTPHeaderField:@"User-Agent"];
+
+        
         if(!m_bodyData.empty()) {
             request.HTTPBody =  [[NSString stringWithUTF8String:m_bodyData.c_str()] dataUsingEncoding:NSUTF8StringEncoding];
         }


[10/11] incubator-milagro-mfa-sdk-ios git commit: Update sdk-core submodule , moving SessionDetails to src folder, code styling

Posted by sa...@apache.org.
Update sdk-core submodule , moving SessionDetails to src folder, code styling


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/commit/0d0cfa88
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/tree/0d0cfa88
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/diff/0d0cfa88

Branch: refs/heads/master
Commit: 0d0cfa885e55dfdc6b31abe493034cd154480a08
Parents: 5a0176e
Author: georgi.georgiev <ge...@certivox.com>
Authored: Sat Sep 17 15:50:13 2016 +0300
Committer: georgi.georgiev <ge...@certivox.com>
Committed: Sat Sep 17 15:50:13 2016 +0300

----------------------------------------------------------------------
 MPinSDK/MPinSDK.xcodeproj/project.pbxproj | 12 +++----
 MPinSDK/MPinSDK/SessionDetails.h          | 16 ----------
 MPinSDK/MPinSDK/SessionDetails.m          | 23 --------------
 mpin-sdk-core                             |  2 +-
 src/MPin.h                                | 44 +++++++++++++-------------
 src/MpinStatus.h                          |  4 ++-
 src/MpinStatus.m                          |  6 ++++
 src/SessionDetails.h                      | 16 ++++++++++
 src/SessionDetails.m                      | 23 ++++++++++++++
 9 files changed, 77 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/0d0cfa88/MPinSDK/MPinSDK.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/MPinSDK/MPinSDK.xcodeproj/project.pbxproj b/MPinSDK/MPinSDK.xcodeproj/project.pbxproj
index 98bba91..6b28fc6 100644
--- a/MPinSDK/MPinSDK.xcodeproj/project.pbxproj
+++ b/MPinSDK/MPinSDK.xcodeproj/project.pbxproj
@@ -8,7 +8,7 @@
 
 /* Begin PBXBuildFile section */
 		FE49FF9C1A1A3C2D000030A4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FE49FF9B1A1A3C2D000030A4 /* Foundation.framework */; };
-		FE7C75FC1CCF8D5B003AEB27 /* SessionDetails.m in Sources */ = {isa = PBXBuildFile; fileRef = FE7C75FB1CCF8D5B003AEB27 /* SessionDetails.m */; };
+		FE7A4AD71D8D72D600E732B4 /* SessionDetails.m in Sources */ = {isa = PBXBuildFile; fileRef = FE7A4AD61D8D72D600E732B4 /* SessionDetails.m */; };
 		FE991F061C5F66540014F23E /* Context.mm in Sources */ = {isa = PBXBuildFile; fileRef = FE991EF61C5F66540014F23E /* Context.mm */; };
 		FE991F071C5F66540014F23E /* HTTPConnector.mm in Sources */ = {isa = PBXBuildFile; fileRef = FE991EFA1C5F66540014F23E /* HTTPConnector.mm */; };
 		FE991F081C5F66540014F23E /* MPin.mm in Sources */ = {isa = PBXBuildFile; fileRef = FE991EFD1C5F66540014F23E /* MPin.mm */; };
@@ -65,8 +65,8 @@
 		FE49FF9B1A1A3C2D000030A4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
 		FE49FF9F1A1A3C2D000030A4 /* MPinSDK-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MPinSDK-Prefix.pch"; sourceTree = "<group>"; };
 		FE49FFAC1A1A3C2D000030A4 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
-		FE7C75FA1CCF8D5B003AEB27 /* SessionDetails.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SessionDetails.h; sourceTree = "<group>"; };
-		FE7C75FB1CCF8D5B003AEB27 /* SessionDetails.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SessionDetails.m; sourceTree = "<group>"; };
+		FE7A4AD51D8D72D600E732B4 /* SessionDetails.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SessionDetails.h; path = ../../src/SessionDetails.h; sourceTree = "<group>"; };
+		FE7A4AD61D8D72D600E732B4 /* SessionDetails.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SessionDetails.m; path = ../../src/SessionDetails.m; sourceTree = "<group>"; };
 		FE991EF51C5F66540014F23E /* Context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Context.h; path = ../../src/Context.h; sourceTree = "<group>"; };
 		FE991EF61C5F66540014F23E /* Context.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = Context.mm; path = ../../src/Context.mm; sourceTree = "<group>"; };
 		FE991EF71C5F66540014F23E /* def.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = def.h; path = ../../src/def.h; sourceTree = "<group>"; };
@@ -181,10 +181,10 @@
 				FE991EFB1C5F66540014F23E /* IUser.h */,
 				FE991EFC1C5F66540014F23E /* MPin.h */,
 				FE991EFD1C5F66540014F23E /* MPin.mm */,
-				FE7C75FA1CCF8D5B003AEB27 /* SessionDetails.h */,
-				FE7C75FB1CCF8D5B003AEB27 /* SessionDetails.m */,
 				FE991EFE1C5F66540014F23E /* MpinStatus.h */,
 				FE991EFF1C5F66540014F23E /* MpinStatus.m */,
+				FE7A4AD51D8D72D600E732B4 /* SessionDetails.h */,
+				FE7A4AD61D8D72D600E732B4 /* SessionDetails.m */,
 				FE991F001C5F66540014F23E /* OTP.h */,
 				FE991F011C5F66540014F23E /* OTP.m */,
 				FE991F021C5F66540014F23E /* Storage.h */,
@@ -342,7 +342,7 @@
 				FE991F0A1C5F66540014F23E /* OTP.m in Sources */,
 				FE991F071C5F66540014F23E /* HTTPConnector.mm in Sources */,
 				FED0EE121C68C984001AB531 /* pair.c in Sources */,
-				FE7C75FC1CCF8D5B003AEB27 /* SessionDetails.m in Sources */,
+				FE7A4AD71D8D72D600E732B4 /* SessionDetails.m in Sources */,
 				FED0EE131C68C984001AB531 /* rand.c in Sources */,
 				FED0EE061C68C984001AB531 /* big.c in Sources */,
 				FED0EE141C68C984001AB531 /* rom.c in Sources */,

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/0d0cfa88/MPinSDK/MPinSDK/SessionDetails.h
----------------------------------------------------------------------
diff --git a/MPinSDK/MPinSDK/SessionDetails.h b/MPinSDK/MPinSDK/SessionDetails.h
deleted file mode 100644
index f19b30b..0000000
--- a/MPinSDK/MPinSDK/SessionDetails.h
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-//  SessionDetails.h
-//  MPinSDK
-//
-//  Created by Georgi Georgiev on 4/26/16.
-//  Copyright � 2016 Certivox. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface SessionDetails : NSObject
-@property (nonatomic, retain) NSString * prerollId;
-@property (nonatomic, retain) NSString * appName;
-@property (nonatomic, retain) NSString * appIconUrl;
-- (id) initWith:(NSString * ) prerollId appName:(NSString *) appName appIconUrl:(NSString *) appIconUrl;
-@end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/0d0cfa88/MPinSDK/MPinSDK/SessionDetails.m
----------------------------------------------------------------------
diff --git a/MPinSDK/MPinSDK/SessionDetails.m b/MPinSDK/MPinSDK/SessionDetails.m
deleted file mode 100644
index b5cc0f6..0000000
--- a/MPinSDK/MPinSDK/SessionDetails.m
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-//  SessionDetails.m
-//  MPinSDK
-//
-//  Created by Georgi Georgiev on 4/26/16.
-//  Copyright � 2016 Certivox. All rights reserved.
-//
-
-#import "SessionDetails.h"
-
-@implementation SessionDetails
-
-- (id) initWith:(NSString * ) prerollId appName:(NSString *) appName appIconUrl:(NSString *) appIconUrl {
-    self = [super init];
-    if (self) {
-        self.prerollId = prerollId;
-        self.appName = appName;
-        self.appIconUrl = appIconUrl;
-    }
-    return self;
-}
-
-@end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/0d0cfa88/mpin-sdk-core
----------------------------------------------------------------------
diff --git a/mpin-sdk-core b/mpin-sdk-core
index e631fb2..5a6c03f 160000
--- a/mpin-sdk-core
+++ b/mpin-sdk-core
@@ -1 +1 @@
-Subproject commit e631fb2db35485114e6628abee12a28989e35cff
+Subproject commit 5a6c03fa0ace77c3c1ae3e497bdca6f78c31b0a8

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/0d0cfa88/src/MPin.h
----------------------------------------------------------------------
diff --git a/src/MPin.h b/src/MPin.h
index e932d5d..9a9142d 100644
--- a/src/MPin.h
+++ b/src/MPin.h
@@ -25,38 +25,38 @@
 
 @interface MPin : NSObject
 
-+ (void)initSDK;
-+ (MpinStatus*)TestBackend:(const NSString*)url;
-+ (MpinStatus*)SetBackend:(const NSString*)url;
-+ (MpinStatus*)TestBackend:(const NSString*)url rpsPrefix:(NSString*)rpsPrefix;
-+ (MpinStatus*)SetBackend:(const NSString*)url rpsPrefix:(NSString*)rpsPrefix;
++ (void) initSDK;
++ (MpinStatus*) TestBackend:(const NSString*)url;
++ (MpinStatus*) SetBackend:(const NSString*)url;
++ (MpinStatus*) TestBackend:(const NSString*)url rpsPrefix:(NSString*)rpsPrefix;
++ (MpinStatus*) SetBackend:(const NSString*)url rpsPrefix:(NSString*)rpsPrefix;
 
-+ (id<IUser>)MakeNewUser:(const NSString*)identity;
-+ (id<IUser>)MakeNewUser:(const NSString*)identity
++ (id<IUser>) MakeNewUser:(const NSString*)identity;
++ (id<IUser>) MakeNewUser:(const NSString*)identity
               deviceName:(const NSString*)devName;
 
-+ (MpinStatus*)StartRegistration:(const id<IUser>)user;
-+ (MpinStatus*)StartRegistration:(const id<IUser>)user userData:(NSString *) userData;
-+ (MpinStatus*)StartRegistration:(const id<IUser>)user activateCode:(NSString *) activateCode;
-+ (MpinStatus*)StartRegistration:(const id<IUser>)user activateCode:(NSString *) activateCode userData:(NSString *) userData;
-+ (MpinStatus*)RestartRegistration:(const id<IUser>)user;
-+ (MpinStatus*)RestartRegistration:(const id<IUser>)user userData:(NSString *) userData;
++ (MpinStatus*) StartRegistration:(const id<IUser>)user;
++ (MpinStatus*) StartRegistration:(const id<IUser>)user userData:(NSString *) userData;
++ (MpinStatus*) StartRegistration:(const id<IUser>)user activateCode:(NSString *) activateCode;
++ (MpinStatus*) StartRegistration:(const id<IUser>)user activateCode:(NSString *) activateCode userData:(NSString *) userData;
++ (MpinStatus*) RestartRegistration:(const id<IUser>)user;
++ (MpinStatus*) RestartRegistration:(const id<IUser>)user userData:(NSString *) userData;
 + (MpinStatus*) ConfirmRegistration:(const id<IUser>)user;
 + (MpinStatus*) ConfirmRegistration:(const id<IUser>)user  pushNotificationIdentifier:(NSString *) pushNotificationIdentifier;
-+ (MpinStatus*)FinishRegistration:(const id<IUser>)user pin:(NSString *) pin;
++ (MpinStatus*) FinishRegistration:(const id<IUser>)user pin:(NSString *) pin;
 
 + (MpinStatus*) StartAuthentication:(const id<IUser>)user;
 + (MpinStatus*) StartAuthentication:(const id<IUser>)user accessCode:(NSString *) accessCode;
 + (MpinStatus*) CheckAccessNumber:(NSString *)an;
-+ (MpinStatus*)FinishAuthentication:(const id<IUser>)user pin:(NSString *) pin;
-+ (MpinStatus*)FinishAuthentication:(const id<IUser>)user pin:(NSString *) pin authResultData:(NSString **)authResultData;
-+ (MpinStatus*)FinishAuthenticationOTP:(id<IUser>)user pin:(NSString *) pin otp:(OTP**)otp;
-+ (MpinStatus*)FinishAuthenticationAN:(id<IUser>)user pin:(NSString *) pin accessNumber:(NSString *)an;
++ (MpinStatus*) FinishAuthentication:(const id<IUser>)user pin:(NSString *) pin;
++ (MpinStatus*) FinishAuthentication:(const id<IUser>)user pin:(NSString *) pin authResultData:(NSString **)authResultData;
++ (MpinStatus*) FinishAuthenticationOTP:(id<IUser>)user pin:(NSString *) pin otp:(OTP**)otp;
++ (MpinStatus*) FinishAuthenticationAN:(id<IUser>)user pin:(NSString *) pin accessNumber:(NSString *)an;
 
-+ (Boolean)Logout:(const id<IUser>)user;
-+ (Boolean)CanLogout:(const id<IUser>)user;
++ (Boolean) Logout:(const id<IUser>)user;
++ (Boolean) CanLogout:(const id<IUser>)user;
 
-+ (NSMutableArray*)listUsers;
++ (NSMutableArray*) listUsers;
 + (NSMutableArray*) listUsers:( NSString *) backendURL;
 + (NSMutableArray*) listBackends;
 + (SessionDetails *) GetSessionDetails:(NSString *) accessCode;
@@ -67,6 +67,6 @@
 + (NSString *) GetClientParam:(const NSString *) key;
 
 /// TEMPORARY FIX
-+ (NSString*)getRPSUrl;
++ (NSString*) getRPSUrl;
 
 @end

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/0d0cfa88/src/MpinStatus.h
----------------------------------------------------------------------
diff --git a/src/MpinStatus.h b/src/MpinStatus.h
index 0df3605..26a3500 100644
--- a/src/MpinStatus.h
+++ b/src/MpinStatus.h
@@ -34,7 +34,9 @@ typedef NS_ENUM(NSInteger, MPinStatus) {
     INCORRECT_PIN, // Remote error - user entered wrong pin
     INCORRECT_ACCESS_NUMBER, // Remote/local error - wrong access number (checksum failed or RPS returned 412)
     HTTP_SERVER_ERROR, // Remote error, that was not reduced to one of the above - the remote server returned internal server error status (5xx)
-    HTTP_REQUEST_ERROR // Remote error, that was not reduced to one of the above - invalid data sent to server, the remote server returned 4xx error status
+    HTTP_REQUEST_ERROR, // Remote error, that was not reduced to one of the above - invalid data sent to server, the remote server returned 4xx error status
+    BAD_USER_AGENT, // Remote error - user agent not supported
+    CLIENT_SECRET_EXPIRED, // Remote error - re-registration required because server master secret expired
 };
 
 @interface MpinStatus : NSObject

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/0d0cfa88/src/MpinStatus.m
----------------------------------------------------------------------
diff --git a/src/MpinStatus.m b/src/MpinStatus.m
index c79545e..0ef5bd9 100644
--- a/src/MpinStatus.m
+++ b/src/MpinStatus.m
@@ -79,6 +79,12 @@
         case HTTP_REQUEST_ERROR:
             result = @"HTTP_REQUEST_ERROR";
             break;
+        case BAD_USER_AGENT:
+            result = @"BAD_USER_AGENT";
+            break;
+        case CLIENT_SECRET_EXPIRED:
+            result = @"CLIENT_SECRET_EXPIRED";
+            break;
         default:
             break;
     }

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/0d0cfa88/src/SessionDetails.h
----------------------------------------------------------------------
diff --git a/src/SessionDetails.h b/src/SessionDetails.h
new file mode 100644
index 0000000..f19b30b
--- /dev/null
+++ b/src/SessionDetails.h
@@ -0,0 +1,16 @@
+//
+//  SessionDetails.h
+//  MPinSDK
+//
+//  Created by Georgi Georgiev on 4/26/16.
+//  Copyright � 2016 Certivox. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface SessionDetails : NSObject
+@property (nonatomic, retain) NSString * prerollId;
+@property (nonatomic, retain) NSString * appName;
+@property (nonatomic, retain) NSString * appIconUrl;
+- (id) initWith:(NSString * ) prerollId appName:(NSString *) appName appIconUrl:(NSString *) appIconUrl;
+@end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/0d0cfa88/src/SessionDetails.m
----------------------------------------------------------------------
diff --git a/src/SessionDetails.m b/src/SessionDetails.m
new file mode 100644
index 0000000..b5cc0f6
--- /dev/null
+++ b/src/SessionDetails.m
@@ -0,0 +1,23 @@
+//
+//  SessionDetails.m
+//  MPinSDK
+//
+//  Created by Georgi Georgiev on 4/26/16.
+//  Copyright � 2016 Certivox. All rights reserved.
+//
+
+#import "SessionDetails.h"
+
+@implementation SessionDetails
+
+- (id) initWith:(NSString * ) prerollId appName:(NSString *) appName appIconUrl:(NSString *) appIconUrl {
+    self = [super init];
+    if (self) {
+        self.prerollId = prerollId;
+        self.appName = appName;
+        self.appIconUrl = appIconUrl;
+    }
+    return self;
+}
+
+@end
\ No newline at end of file


[07/11] incubator-milagro-mfa-sdk-ios git commit: Merge pull request #8 in MM/mpin-sdk-ios from update-submodule-milagro to master

Posted by sa...@apache.org.
Merge pull request #8 in MM/mpin-sdk-ios from update-submodule-milagro to master

* commit '1c4b71636d3b7589d420cc65ea8a290f20ac9869':
  Update submodule to Milagro


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/commit/4909c03c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/tree/4909c03c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/diff/4909c03c

Branch: refs/heads/master
Commit: 4909c03c96e33beb8a7cbd0ac6563e7e5bd26955
Parents: 53f1ebb 1c4b716
Author: Simeon Aladjem <si...@certivox.com>
Authored: Mon Sep 12 10:56:12 2016 +0200
Committer: Simeon Aladjem <si...@certivox.com>
Committed: Mon Sep 12 10:56:12 2016 +0200

----------------------------------------------------------------------
 .gitmodules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------