Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Add support for getting service definitions from the MFA platform #3

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1ab5b5d
Add support for getting service definitions from the MFA platform
Dec 7, 2016
2451a65
Add MFA Support
Dec 21, 2016
c2a39a8
Merge pull request #1 from miracl/MFA
Georgiev79 Dec 21, 2016
50ed83c
Resolve issue with LLVM compiler
Dec 21, 2016
d14bf28
Change FinishAuthentication method, implement clear data storage method
Jan 3, 2017
5b0133b
Add trusted domains
Jan 4, 2017
533bb88
Add GetAccessCode
Jan 5, 2017
5a68246
ADD User Existing method
Jan 6, 2017
c8f7f7d
Polymorph IsUserExisting
Jan 9, 2017
6f5c12f
Extends status code with addding BadClientVersion
Jan 10, 2017
ac88844
Added new configurations
Jan 12, 2017
4fc34a7
Merge pull request #2 from miracl/Configurations
Georgiev79 Jan 12, 2017
00b1f96
update submodule file with the latest sdk core rev
Jan 19, 2017
fda7dff
Add Notification in case all users has been deleted by the core sdk
Feb 14, 2017
dc6ad4a
Adding Registration Expiration
Feb 22, 2017
b0c419d
DVS
Feb 28, 2018
78c05d4
Added IsRegistationTokenSet
Feb 28, 2018
bd93a13
Added getPINLength
Feb 28, 2018
540a2ed
"Expiration" handling restored, Archive configuration pointing to "Pr…
Feb 28, 2018
46c039c
REGISTRATION_EXPIRED added back to MpinStatus
Feb 28, 2018
c77bcf9
Sign method fixed
Mar 2, 2018
4811f6c
Merge pull request #3 from miracl/DVS
Mar 6, 2018
4d3b98b
Submodule updated
Mar 6, 2018
fbc693f
Merge branch 'master' into Second-PIN-Wrong-PIN
Mar 6, 2018
510b5fd
Some methods renaimed
Apr 5, 2018
43bc9cf
Merge pull request #4 from miracl/Dev
Apr 5, 2018
38b6bf4
Restored OTP wrapper methods
Apr 24, 2018
605c414
Merge pull request #5 from miracl/OTPWrapping
tahatunga Apr 24, 2018
0eab979
Update SDK core with logo_url fix
Apr 25, 2018
2fa0309
Revert to `rps` (v1) as `rps/v2` changes will be on `rps-v2` branch
May 17, 2018
9fca2db
Merge pull request #6 from miracl/rps-v1
tahatunga May 21, 2018
bcf8569
RegCode wrapped
May 22, 2018
86ede27
SDKRegCode renamed to RegCode
May 22, 2018
787005e
Merge pull request #7 from miracl/RegCode
May 22, 2018
6282c56
Update doc with MPinMFA API, DVS, Reg Code (#8)
Jun 4, 2018
4d2fe22
IsUserExisting fix (#9)
tahatunga Jun 5, 2018
aef5627
Handling Register Only QRs (#10)
tahatunga Jul 9, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "mpin-sdk-core"]
path = mpin-sdk-core
url = https://github.com/apache/incubator-milagro-mfa-sdk-core.git
url = https://github.com/miracl/incubator-milagro-mfa-sdk-core.git
4,815 changes: 4,672 additions & 143 deletions MPinSDK/MPinSDK.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "73E1B20CF21226571ACC813FEA2DE2FA6C0CF74A",
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {

},
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
"73E1B20CF21226571ACC813FEA2DE2FA6C0CF74A" : 9223372036854775807,
"9980D11FF5B6CE970FF3598FD73DBFED058471FB" : 9223372036854775807
},
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "64196D4C-A029-43E0-A441-4E613AC485B9",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
"73E1B20CF21226571ACC813FEA2DE2FA6C0CF74A" : "incubator-milagro-mfa-sdk-ios\/",
"9980D11FF5B6CE970FF3598FD73DBFED058471FB" : "incubator-milagro-mfa-sdk-ios\/mpin-sdk-core\/"
},
"DVTSourceControlWorkspaceBlueprintNameKey" : "MPinSDK",
"DVTSourceControlWorkspaceBlueprintVersion" : 204,
"DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "MPinSDK\/MPinSDK.xcodeproj",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/miracl\/incubator-milagro-mfa-sdk-ios",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "73E1B20CF21226571ACC813FEA2DE2FA6C0CF74A"
},
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/miracl\/incubator-milagro-mfa-sdk-core.git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "9980D11FF5B6CE970FF3598FD73DBFED058471FB"
}
]
}
28 changes: 2 additions & 26 deletions MPinSDK/MPinSDK.xcodeproj/xcshareddata/xcschemes/MPinSDK.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -20,20 +20,6 @@
ReferencedContainer = "container:MPinSDK.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FE49FFA71A1A3C2D000030A4"
BuildableName = "MPinSDKTests.xctest"
BlueprintName = "MPinSDKTests"
ReferencedContainer = "container:MPinSDK.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
Expand All @@ -42,16 +28,6 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FE49FFA71A1A3C2D000030A4"
BuildableName = "MPinSDKTests.xctest"
BlueprintName = "MPinSDKTests"
ReferencedContainer = "container:MPinSDK.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
Expand Down Expand Up @@ -107,7 +83,7 @@
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
buildConfiguration = "Prod"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
25 changes: 25 additions & 0 deletions MPinSDK/MPinSDK/BridgeTypes/BridgeSignature.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// Signature.h
// MPinSDK
//
// Created by Tihomir Ganev on 11/7/17.
// Copyright © 2017 Certivox. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface BridgeSignature : NSObject

-(id) initWith: (NSData *) strHash
mpinId: (NSData *) strMpinId
strU: (NSData *) strU
strV: (NSData *) strV
strPublicKey: (NSData *) strPublicKey;

@property (nonatomic) NSData *strHash;
@property (nonatomic) NSData *strMpinId;
@property (nonatomic) NSData *strU;
@property (nonatomic) NSData *strV;
@property (nonatomic) NSData *strPublicKey;

@end
30 changes: 30 additions & 0 deletions MPinSDK/MPinSDK/BridgeTypes/BridgeSignature.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// Signature.m
// MPinSDK
//
// Created by Tihomir Ganev on 11/7/17.
// Copyright © 2017 Certivox. All rights reserved.
//

#import "BridgeSignature.h"

@implementation BridgeSignature

-(id) initWith: (NSData *) strHash
mpinId: (NSData *) strMpinId
strU: (NSData *) strU
strV: (NSData *) strV
strPublicKey: (NSData *) strPublicKey
{
self = [super init];
if (self) {
_strHash = strHash;
_strMpinId = strMpinId;
_strU = strU;
_strV = strV;
_strPublicKey = strPublicKey;
}
return self;
}

@end
28 changes: 28 additions & 0 deletions MPinSDK/MPinSDK/BridgeTypes/Expiration.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/

#import <Foundation/Foundation.h>

@interface Expiration : NSObject
@property ( nonatomic, readonly ) int expireTimeSeconds;
@property ( nonatomic, readonly ) int nowTimeSeconds;

-(id) initWith:(int) nowTime expireTime:(int) expTime;

@end
27 changes: 5 additions & 22 deletions src/User.mm → MPinSDK/MPinSDK/BridgeTypes/Expiration.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,17 @@ Licensed to the Apache Software Foundation (ASF) under one
under the License.
*/

#import "User.h"
#import "Expiration.h"

@interface User() {
UserPtr userPtr;
}

@end
@implementation Expiration

@implementation User

- (id) initWith:(UserPtr) usrPtr {
-(id) initWith:(int) nowTime expireTime:(int) expTime {
self = [super init];
if (self) {
userPtr = usrPtr;
_expireTimeSeconds = expTime;
_nowTimeSeconds = nowTime;
}
return self;
}

-(NSString *) getIdentity {
return [NSString stringWithUTF8String:userPtr->GetId().c_str()];
}

-(UserState) getState {
return (UserState)userPtr->GetState();
}

-(UserPtr) getUserPtr {
return userPtr;
}

@end
14 changes: 12 additions & 2 deletions src/IUser.h → MPinSDK/MPinSDK/BridgeTypes/IUser.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

#import <Foundation/Foundation.h>
#import "Expiration.h"

typedef NS_ENUM(NSInteger, UserState) {
INVALID = 0,
Expand All @@ -28,6 +29,15 @@ typedef NS_ENUM(NSInteger, UserState) {
};

@protocol IUser <NSObject>
- (NSString*)getIdentity;
- (UserState)getState;

- (NSString*) getIdentity;
- (UserState) getState;
- (NSString*) getBackend;
- (NSString*) getCustomerId;
- (NSString*) getAppId;
- (NSString*) getMPinId;
- (Expiration*) getRegistrationExpiration;
- ( int ) getPinLength;
- (BOOL) canSign;

@end
73 changes: 73 additions & 0 deletions MPinSDK/MPinSDK/BridgeTypes/MpinStatus.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, MPinStatus) {
OK = 0,
// OK
PIN_INPUT_CANCELED = 1,
// Local error, returned when user cancels pin entering
CRYPTO_ERROR = 2 ,
// Local error in crypto functions
STORAGE_ERROR = 3,
// Local storage related error
NETWORK_ERROR = 4 ,
// Local error - cannot connect to remote server (no internet, or invalid server/port)
RESPONSE_PARSE_ERROR = 5,
// Local error - cannot parse json response from remote server (invalid json or unexpected json structure)
FLOW_ERROR = 6,
// Local error - unproper MPinSDK class usage
IDENTITY_NOT_AUTHORIZED = 7,
// Remote error - the remote server refuses user registration
IDENTITY_NOT_VERIFIED = 8,
// Remote error - the remote server refuses user registration because identity is not verified
REQUEST_EXPIRED = 9,
// Remote error - the register/authentication request expired
REVOKED = 10,
// Remote error - cannot get time permit (propably the user is temporary suspended)
INCORRECT_PIN = 11,
// Remote error - user entered wrong pin
INCORRECT_ACCESS_NUMBER = 12,
// Remote/local error - wrong access number (checksum failed or RPS returned 412)
HTTP_SERVER_ERROR = 13,
// Remote error, that was not reduced to one of the above - the remote server returned internal server error status (5xx)
HTTP_REQUEST_ERROR = 14,
// 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 = 15,
// Remote error - user agent not supported
CLIENT_SECRET_EXPIRED = 16,
// Remote error - re-registration required because server master secret expired
BAD_CLIENT_VERSION = 17,
// Remote error - wrong client app version
UNTRUSTED_DOMAIN_ERROR = 18,
// Local error - a request to a domain, that is not in the trusted list was attempted
REGISTRATION_EXPIRED = 19
// Remote error - regOTT 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
6 changes: 6 additions & 0 deletions src/MpinStatus.m → MPinSDK/MPinSDK/BridgeTypes/MpinStatus.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ - (NSString *) getStatusCodeAsString {
case CLIENT_SECRET_EXPIRED:
result = @"CLIENT_SECRET_EXPIRED";
break;
case UNTRUSTED_DOMAIN_ERROR:
result = @"UNTRUSTED_DOMAIN_ERROR";
break;
case REGISTRATION_EXPIRED:
result = @"REGISTRATION_EXPIRED";
break;
default:
break;
}
Expand Down
13 changes: 13 additions & 0 deletions MPinSDK/MPinSDK/BridgeTypes/MultiFactor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// MultiFactor.h
// MPinSDK
//
// Created by Tihomir Ganev on 8.12.17.
// Copyright © 2017 Certivox. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface MultiFactor : NSObject

@end
13 changes: 13 additions & 0 deletions MPinSDK/MPinSDK/BridgeTypes/MultiFactor.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// MultiFactor.m
// MPinSDK
//
// Created by Tihomir Ganev on 8.12.17.
// Copyright © 2017 Certivox. All rights reserved.
//

#import "MultiFactor.h"

@implementation MultiFactor

@end
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions MPinSDK/MPinSDK/BridgeTypes/RegCode.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// RegCode.h
// MPinSDK
//
// Created by Tihomir Ganev on 22.05.18.
// Copyright © 2018 Certivox. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "OTP.h"

@interface RegCode : OTP

@end
13 changes: 13 additions & 0 deletions MPinSDK/MPinSDK/BridgeTypes/RegCode.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// RegCode.m
// MPinSDK
//
// Created by Tihomir Ganev on 22.05.18.
// Copyright © 2018 Certivox. All rights reserved.
//

#import "RegCode.h"

@implementation RegCode

@end
Loading