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/16 10:25:02 UTC

[01/10] incubator-milagro-mfa-sdk-android git commit: Apply MPinSDK API changes

Repository: incubator-milagro-mfa-sdk-android
Updated Branches:
  refs/heads/master 8dc048199 -> 790730437


Apply MPinSDK API changes

	Remove GetPrerollId
	Add DeleteUserPerBackend and GetSessionDetails


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

Branch: refs/heads/master
Commit: 39f46eab10c2dc679626c537b96125e223011040
Parents: ac9ce68
Author: Vassil Angelov <va...@miracl.com>
Authored: Tue Apr 26 15:37:23 2016 +0300
Committer: Vladislav Mitov <vl...@gmail.com>
Committed: Mon May 9 10:27:21 2016 +0300

----------------------------------------------------------------------
 build.gradle                                    |  2 +-
 gradle.properties                               |  4 +--
 mpin-sdk-core                                   |  2 +-
 mpinsdk/build.gradle                            |  2 +-
 .../main/java/com/miracl/mpinsdk/MPinSDK.java   | 13 +++++++--
 .../miracl/mpinsdk/model/SessionDetails.java    | 26 +++++++++++++++++
 mpinsdk/src/main/jni/JNIMPinSDK.cpp             | 30 ++++++++++++++++----
 7 files changed, 66 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/39f46eab/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index e0b366a..168f129 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,7 +5,7 @@ buildscript {
         jcenter()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:1.5.0'
+        classpath 'com.android.tools.build:gradle:2.0.0'
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/39f46eab/gradle.properties
----------------------------------------------------------------------
diff --git a/gradle.properties b/gradle.properties
index dc51216..63a8f4b 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -16,8 +16,8 @@
 # This option should only be used with decoupled projects. More details, visit
 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
 # org.gradle.parallel=true
-VERSION_NAME=1.0-SNAPSHOT
-VERSION_CODE=1
+VERSION_NAME=1.1-SNAPSHOT
+VERSION_CODE=2
 GROUP=com.miracl
 RELEASE_REPOSITORY_URL=http://10.10.23.15:8081/content/repositories/mpinsdk/
 SNAPSHOT_REPOSITORY_URL=http://10.10.23.15:8081/content/repositories/mpinsdk-snapshot/

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/39f46eab/mpin-sdk-core
----------------------------------------------------------------------
diff --git a/mpin-sdk-core b/mpin-sdk-core
index acd0530..0c9b7fa 160000
--- a/mpin-sdk-core
+++ b/mpin-sdk-core
@@ -1 +1 @@
-Subproject commit acd0530bc597f27c93ebeda3059107f553b955a0
+Subproject commit 0c9b7fa6256ad4b2b90a14ce3ce7aabfbe6c16f6

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/39f46eab/mpinsdk/build.gradle
----------------------------------------------------------------------
diff --git a/mpinsdk/build.gradle b/mpinsdk/build.gradle
index 30196c8..ff85523 100644
--- a/mpinsdk/build.gradle
+++ b/mpinsdk/build.gradle
@@ -4,7 +4,7 @@ import org.apache.tools.ant.taskdefs.condition.Os
 
 android {
     compileSdkVersion 23
-    buildToolsVersion "23.0.1"
+    buildToolsVersion "23.0.2"
 
     defaultConfig {
         minSdkVersion 16

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/39f46eab/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
----------------------------------------------------------------------
diff --git a/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java b/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
index 3077eb5..6eddc3e 100644
--- a/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
+++ b/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
@@ -22,6 +22,7 @@ package com.miracl.mpinsdk;
 import android.content.Context;
 
 import com.miracl.mpinsdk.model.OTP;
+import com.miracl.mpinsdk.model.SessionDetails;
 import com.miracl.mpinsdk.model.Status;
 import com.miracl.mpinsdk.model.User;
 
@@ -141,14 +142,18 @@ public class MPinSDK implements Closeable {
         return nFinishAuthenticationAN(mPtr, user, pin, accessNumber);
     }
 
-    public String GetPrerollUserId(String accessCode) {
-        return nGetPrerollUserId(mPtr, accessCode);
+    public Status GetSessionDetails(String accessCode, SessionDetails sessionDetails) {
+        return nGetSessionDetails(mPtr, accessCode, sessionDetails);
     }
 
     public void DeleteUser(User user) {
         nDeleteUser(mPtr, user);
     }
 
+    public void DeleteUser(User user, String backend) {
+        nDeleteUserForBackend(mPtr, user, backend);
+    }
+
     public Status ListUsers(List<User> users) {
         return nListUsers(mPtr, users);
     }
@@ -215,10 +220,12 @@ public class MPinSDK implements Closeable {
 
     private native Status nFinishAuthenticationAN(long ptr, User user, String pin, String accessNumber);
 
-    private native String nGetPrerollUserId(long ptr, String key);
+    private native Status nGetSessionDetails(long ptr, String accessCode, SessionDetails sessionDetails);
 
     private native void nDeleteUser(long ptr, User user);
 
+    private native void nDeleteUserForBackend(long ptr, User user, String backend);
+
     private native Status nListUsers(long ptr, List<User> users);
 
     private native Status nListUsersForBackend(long ptr, List<User> users, String backend);

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/39f46eab/mpinsdk/src/main/java/com/miracl/mpinsdk/model/SessionDetails.java
----------------------------------------------------------------------
diff --git a/mpinsdk/src/main/java/com/miracl/mpinsdk/model/SessionDetails.java b/mpinsdk/src/main/java/com/miracl/mpinsdk/model/SessionDetails.java
new file mode 100644
index 0000000..e85dfce
--- /dev/null
+++ b/mpinsdk/src/main/java/com/miracl/mpinsdk/model/SessionDetails.java
@@ -0,0 +1,26 @@
+/***************************************************************
+ * 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.
+ ***************************************************************/
+package com.miracl.mpinsdk.model;
+
+public class SessionDetails {
+
+    public String prerollId;
+    public String appName;
+    public String appIconUrl;
+}

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/39f46eab/mpinsdk/src/main/jni/JNIMPinSDK.cpp
----------------------------------------------------------------------
diff --git a/mpinsdk/src/main/jni/JNIMPinSDK.cpp b/mpinsdk/src/main/jni/JNIMPinSDK.cpp
index 4f684b3..3a06254 100644
--- a/mpinsdk/src/main/jni/JNIMPinSDK.cpp
+++ b/mpinsdk/src/main/jni/JNIMPinSDK.cpp
@@ -183,11 +183,25 @@ static jobject nFinishAuthenticationAN(JNIEnv* env, jobject jobj, jlong jptr, jo
 	return MakeJavaStatus(env, sdk->FinishAuthenticationAN(JavaToMPinUser(env, juser), JavaToStdString(env, jpin), JavaToStdString(env, jaccessNumber)));
 }
 
-static jstring nGetPrerollUserId(JNIEnv* env, jobject jobj, jlong jptr, jstring jaccessCode)
-{
+static jobject nGetSessionDetails(JNIEnv* env, jobject jobj, jlong jptr, jstring jaccessCode, jobject jsessionDetails){
     MPinSDK* sdk = (MPinSDK*) jptr;
-    MPinSDK::String result = sdk->GetPrerollUserId(JavaToStdString(env, jaccessCode));
-    return env->NewStringUTF(result.c_str());
+    MPinSDK::SessionDetails sessionDetails;
+
+    MPinSDK::Status status = sdk->GetSessionDetails(JavaToStdString(env,jaccessCode), sessionDetails);
+
+    if(status == MPinSDK::Status::OK)
+   	{
+   		jclass clsSessionDetails = env->FindClass("com/miracl/mpinsdk/model/SessionDetails");
+   		jfieldID fIdPrerollId = env->GetFieldID(clsSessionDetails, "prerollId", "Ljava/lang/String;");
+   		jfieldID fIdAppName = env->GetFieldID(clsSessionDetails, "appName", "Ljava/lang/String;");
+   		jfieldID fIdAppIconUrl = env->GetFieldID(clsSessionDetails, "appIconUrl", "Ljava/lang/String;");
+
+   		env->SetObjectField(jsessionDetails, fIdPrerollId, env->NewStringUTF(sessionDetails.prerollId.c_str()));
+   		env->SetObjectField(jsessionDetails, fIdAppName, env->NewStringUTF(sessionDetails.appName.c_str()));
+   		env->SetObjectField(jsessionDetails, fIdAppIconUrl, env->NewStringUTF(sessionDetails.appIconUrl.c_str()));
+   	}
+
+    return MakeJavaStatus(env, status);
 }
 
 static void nDeleteUser(JNIEnv* env, jobject jobj, jlong jptr, jobject juser)
@@ -196,6 +210,11 @@ static void nDeleteUser(JNIEnv* env, jobject jobj, jlong jptr, jobject juser)
 	sdk->DeleteUser(JavaToMPinUser(env, juser));
 }
 
+static void nDeleteUserForBackend(JNIEnv* env, jobject jobj, jlong jptr, jobject juser, jstring jbackend){
+    MPinSDK* sdk = (MPinSDK*) jptr;
+    sdk->DeleteUser(JavaToMPinUser(env, juser), JavaToStdString(env, jbackend));
+}
+
 static jobject nListUsers(JNIEnv* env, jobject jobj, jlong jptr, jobject jusersList)
 {
 	MPinSDK* sdk = (MPinSDK*) jptr;
@@ -312,7 +331,8 @@ static JNINativeMethod g_methodsMPinSDK[] =
 	NATIVE_METHOD(nFinishAuthenticationOTP, "(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;Lcom/miracl/mpinsdk/model/OTP;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nFinishAuthenticationAN, "(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;Ljava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nDeleteUser, "(JLcom/miracl/mpinsdk/model/User;)V"),
-    NATIVE_METHOD(nGetPrerollUserId, "(JLjava/lang/String;)Ljava/lang/String;"),
+	NATIVE_METHOD(nDeleteUserForBackend, "(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;)V"),
+	NATIVE_METHOD(nGetSessionDetails, "(JLjava/lang/String;Lcom/miracl/mpinsdk/model/SessionDetails;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nListUsers, "(JLjava/util/List;)Lcom/miracl/mpinsdk/model/Status;"),
     NATIVE_METHOD(nListUsersForBackend, "(JLjava/util/List;Ljava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
     NATIVE_METHOD(nListBackends, "(JLjava/util/List;)Lcom/miracl/mpinsdk/model/Status;"),


[08/10] incubator-milagro-mfa-sdk-android git commit: Merge pull request #4 in MM/mpin-sdk-android from update-submodule-milagro to master

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

* commit 'd3543e2be0922346064366b7dc79eec60d33755b':
  Update submodule to Milagro


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

Branch: refs/heads/master
Commit: d1e1bf8717d8bba9b49fda81960ddff70ce3ba38
Parents: ff6bb04 d3543e2
Author: Simeon Aladjem <si...@certivox.com>
Authored: Mon Sep 12 09:40:40 2016 +0200
Committer: Simeon Aladjem <si...@certivox.com>
Committed: Mon Sep 12 09:40:40 2016 +0200

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



[04/10] incubator-milagro-mfa-sdk-android git commit: Release 1.1

Posted by sa...@apache.org.
Release 1.1


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

Branch: refs/heads/master
Commit: 2f8b253fc7d27c71a7765e83813a22e228c6ab1e
Parents: 39f46ea
Author: Vassil Angelov <va...@miracl.com>
Authored: Thu Jul 14 11:31:03 2016 +0300
Committer: Vassil Angelov <va...@miracl.com>
Committed: Thu Jul 14 11:31:03 2016 +0300

----------------------------------------------------------------------
 gradle.properties | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/2f8b253f/gradle.properties
----------------------------------------------------------------------
diff --git a/gradle.properties b/gradle.properties
index 63a8f4b..78806a8 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -16,8 +16,7 @@
 # This option should only be used with decoupled projects. More details, visit
 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
 # org.gradle.parallel=true
-VERSION_NAME=1.1-SNAPSHOT
-VERSION_CODE=2
+VERSION_NAME=1.1
 GROUP=com.miracl
 RELEASE_REPOSITORY_URL=http://10.10.23.15:8081/content/repositories/mpinsdk/
 SNAPSHOT_REPOSITORY_URL=http://10.10.23.15:8081/content/repositories/mpinsdk-snapshot/


[09/10] incubator-milagro-mfa-sdk-android git commit: Fix all users listed for each backend

Posted by sa...@apache.org.
Fix all users listed for each backend

See #MAASMOB-326


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

Branch: refs/heads/master
Commit: f69d1a2de670eaf494a7261dae0b3460a8d8a34b
Parents: d1e1bf8
Author: Vassil Angelov <va...@miracl.com>
Authored: Tue Sep 13 15:00:51 2016 +0300
Committer: Vassil Angelov <va...@miracl.com>
Committed: Tue Sep 13 15:00:51 2016 +0300

----------------------------------------------------------------------
 mpinsdk/src/main/java/com/miracl/mpinsdk/model/User.java | 4 ++++
 mpinsdk/src/main/jni/JNIMPinSDK.cpp                      | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/f69d1a2d/mpinsdk/src/main/java/com/miracl/mpinsdk/model/User.java
----------------------------------------------------------------------
diff --git a/mpinsdk/src/main/java/com/miracl/mpinsdk/model/User.java b/mpinsdk/src/main/java/com/miracl/mpinsdk/model/User.java
index 2f48a07..3a23693 100644
--- a/mpinsdk/src/main/java/com/miracl/mpinsdk/model/User.java
+++ b/mpinsdk/src/main/java/com/miracl/mpinsdk/model/User.java
@@ -52,6 +52,10 @@ public class User implements Closeable {
         }
     }
 
+    public String getBackend() {
+        return nGetBackend(mPtr);
+    }
+
     public boolean isUserSelected() {
         return isUserSelected;
     }

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/f69d1a2d/mpinsdk/src/main/jni/JNIMPinSDK.cpp
----------------------------------------------------------------------
diff --git a/mpinsdk/src/main/jni/JNIMPinSDK.cpp b/mpinsdk/src/main/jni/JNIMPinSDK.cpp
index ace68df..a570ec0 100644
--- a/mpinsdk/src/main/jni/JNIMPinSDK.cpp
+++ b/mpinsdk/src/main/jni/JNIMPinSDK.cpp
@@ -249,7 +249,7 @@ static jobject nListUsersForBackend(JNIEnv* env, jobject jobj, jlong jptr, jobje
 {
     MPinSDK* sdk = (MPinSDK*) jptr;
     	std::vector<MPinSDK::UserPtr> users;
-    	MPinSDK::Status status = sdk->ListAllUsers(users);
+    	MPinSDK::Status status = sdk->ListUsers(users, JavaToStdString(env, jbackend));
 
         if(status == MPinSDK::Status::OK)
         {


[10/10] incubator-milagro-mfa-sdk-android git commit: Add documentation

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


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

Branch: refs/heads/master
Commit: 790730437b042754d3aaf07771655ae43d3a60ac
Parents: f69d1a2
Author: Simeon Aladjem <si...@miracl.com>
Authored: Fri Sep 16 13:22:33 2016 +0300
Committer: Simeon Aladjem <si...@miracl.com>
Committed: Fri Sep 16 13:22:33 2016 +0300

----------------------------------------------------------------------
 README.md | 297 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 288 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/79073043/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 07ff966..411e498 100644
--- a/README.md
+++ b/README.md
@@ -1,22 +1,301 @@
-# Android M-Pin SDK
+# Milagro Mobile SDK for Android
 
-## Building the M-Pin Mobile SDK for Android
+## Building the Milagro Mobile SDK for Android
 
 ### Prerequisites
 
 1. Download and install Android Studio or higher with Android SDK 16 or higher
-1. Download or Clone the project and its submodule to \<mpin-sdk-android\>
+1. Download or Clone the project and its submodule to \<milagro-sdk-android\>
 
-### Building the M-Pin Mobile SDK
+### Building the Milagro Mobile SDK
 
 #### From Android Studio
-1. Import the project - File-> Open -> \<mpin-sdk-android\>
+1. Import the project - File-> Open -> \<milagro-sdk-android\>
 1. From Gradle Tool View select :mpinsdk -> Tasks -> build -> build
-1. The assembled aars will be located in \<mpin-sdk-android\>/mpinsdk/build/outputs/aar
+1. The assembled aars will be located in \<milagro-sdk-android\>/mpinsdk/build/outputs/aar
  
 #### From Command Line
-1. Navigate to \<mpin-sdk-android\>
+1. Navigate to \<milagro-sdk-android\>
 1. Execute ./gradlew build
-1. The assembled aars will be located in \<mpin-sdk-android\>/mpinsdk/build/outputs/aar
+1. The assembled aars will be located in \<milagro-sdk-android\>/mpinsdk/build/outputs/aar
 
-For further details, see [M-Pin Mobile SDK for Android Online Help](http://docs.miracl.com/m-pin-mobile-sdk-for-android)
+For further details, see [Milagro Mobile SDK for Android Documentation](http://docs.milagro.io/en/mfa/mobile-sdk-android/milagro-mfa-mobile-sdk-developer-guide.html)
+
+## SDK API for Android (`com.miracl.mpinsdk.MPinSDK`)
+
+The Android SDK API is used by Android 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 a `Status` object which is defined as follows:
+
+```java
+public class Status {
+
+    public enum Code {
+        OK,
+        CANCELED_BY_USER,        // Local error, returned when user cancels pin entering
+        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, 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
+        BAD_USER_AGENT,          // Remote error - user agent not supported
+        CLIENT_SECRET_EXPIRED    // Remote error - re-registration required because server master secret expired
+    }
+
+    public Status(int statusCode, String error) {
+        ...
+    }
+
+    public Code getStatusCode() {
+        ...
+    }
+
+    public String getErrorMessage() {
+        ...
+    }
+
+    @Override
+    public String toString() {
+        ...
+    }
+
+    ...
+}
+```
+
+##### `MPinSDK()`
+This method constructs an SDK instance.
+
+##### `Status Init(Map<String, String> config, Context context)`
+##### `Status Init(Map<String, String> config, Context context, Map<String, String> customHeaders)`
+This method initializes the SDK. It receives a key/value map of the configuration parameters.
+The configuration is a key-value map into which different configuration options can be inserted. This is a flexible way of passing configurations to the SDK, as the method parameters will not change when new configuration parameters are added. 
+Unsupported parameters are ignored. Currently, the SDK recognizes the following parameters:
+
+* `backend` - the URL of the Milagro MFA back-end service (Mandatory)
+* `rpsPrefix` - the prefix that should be added for requests to the RPS (Optional). The default value is `"rps"`.
+
+The `customHeaders` parameter is optional and allows the caller to pass additional map of custom headers, which will be added to any HTTP request that the SDK executes.
+
+##### `Status TestBackend(String server)`
+##### `Status TestBackend(String server, String rpsPrefix)`
+This method will test whether `server` 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`.
+
+##### `Status SetBackend(String server)`
+##### `Status SetBackend(String server, String rpsPrefix)`
+This method will change the currently configured back-end in the SDK.
+Initially the back-end might be set through the `Init()` method, but then it might be change using this method.
+`server` 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`.
+
+##### `User MakeNewUser(String id)`
+##### `User MakeNewUser(String id, String deviceName)`
+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 id 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:
+
+
+```java
+public class User implements Closeable {
+ 
+    public enum State {
+        INVALID,
+        STARTED_REGISTRATION,
+        ACTIVATED,
+        REGISTERED,
+        BLOCKED
+    };
+     
+    public String getId() {
+        ...
+    }
+ 
+    public State getState() {
+        ...
+    }
+
+    public String getBackend() {
+        ...
+    }
+     
+    @Override
+    public String toString() {
+        return getId();
+    }
+ 
+    ...
+}
+```
+
+The newly created user is in the `INVALID` state.
+
+##### `void DeleteUser(User 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.
+
+##### `void ListUsers(List<User> users)`
+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.
+
+##### `Status ListUsers(List<User> users, String backend)`
+This method populates the provided list with all the users that are associated with the provided `backend`.
+Different users might be in different states, reflecting their registration status.
+The method will return Status `OK` on success and `FLOW_ERROR` if the SDK was not initialized.
+
+##### `Status ListAllUsers(List<User> users)`
+This method populates the provided list with all the users associated with all the backends know to the SDK.
+Different users might be in different states, reflecting their registration status.
+The user association to a backend could be retrieved through the `User.getBackend()` method.
+The method will return Status `OK` on success and `FLOW_ERROR` if the SDK was not initialized.
+
+##### `Status ListBackends(List<String> backends)`
+This method will populate the provided ListAllUsers with all the backends known to the SDK.
+The method will return Status `OK` on success and `FLOW_ERROR` if the SDK was not initialized.
+
+##### `Status GetSessionDetails(String accessCode, SessionDetails sessionDetails)`
+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:
+```java
+public class SessionDetails {
+
+    public String prerollId;
+    public String appName;
+    public String appIconUrl;
+}
+```
+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.
+
+##### `Status StartRegistration(User user)`
+##### `Status StartRegistration(User user, String activateCode)`
+##### `Status StartRegistration(User user, String activateCode, String 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`.
+
+
+##### `Status RestartRegistration(User user)`
+##### `Status RestartRegistration(User user, String 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`.
+
+
+##### `Status ConfirmRegistration(User user)`
+##### `Status ConfirmRegistration(User user, String pushMessageIdentifier)`
+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 `pushMessageIdentifier`, 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.
+
+##### `Status FinishRegistration(User user, String 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`.
+
+
+##### `Status StartAuthentication(User user)`
+##### `Status StartAuthentication(User user, String 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. 
+
+
+##### `Status CheckAccessNumber(String accessNumber)`
+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.
+
+##### `Status FinishAuthentication(User user, String pin)`
+##### `Status FinishAuthentication(User user, String pin, StringBuilder 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`.
+
+##### `Status FinishAuthenticationOTP(User user, String pin, 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:
+```java
+public class OTP {
+    public String otp;
+    public long expireTime;
+    public int ttlSeconds;
+    public long nowTime;
+    public Status status;
+}
+```
+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`.
+
+##### `Status FinishAuthenticationAN(User user, String pin, String accessNumber)`
+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.
+`accessNumber` 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. 
+
+##### `bool CanLogout(User 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.
+
+##### `bool Logout(User 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.
+
+##### `String GetClientParam(String 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


[02/10] incubator-milagro-mfa-sdk-android 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-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/commit/ac9ce683
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/tree/ac9ce683
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/diff/ac9ce683

Branch: refs/heads/master
Commit: ac9ce68357ce465ccfa1ed572575a07799e355f2
Parents: f914e06
Author: Vassil Angelov <va...@miracl.com>
Authored: Thu Apr 7 11:20:13 2016 +0300
Committer: Vladislav Mitov <vl...@gmail.com>
Committed: Mon May 9 10:27:21 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-android/blob/ac9ce683/mpin-sdk-core
----------------------------------------------------------------------
diff --git a/mpin-sdk-core b/mpin-sdk-core
index 58448b9..acd0530 160000
--- a/mpin-sdk-core
+++ b/mpin-sdk-core
@@ -1 +1 @@
-Subproject commit 58448b9b6a1a05e8f5f662bd6c34a0192dca43c8
+Subproject commit acd0530bc597f27c93ebeda3059107f553b955a0


[03/10] incubator-milagro-mfa-sdk-android git commit: Integrate MaaS support

Posted by sa...@apache.org.
Integrate MaaS support

Integrate list users per backend and list backends


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

Branch: refs/heads/master
Commit: f914e067f27aea0166416981d29e520973b69973
Parents: 8dc0481
Author: Vassil Angelov <va...@miracl.com>
Authored: Fri Apr 1 17:24:02 2016 +0300
Committer: Vladislav Mitov <vl...@gmail.com>
Committed: Mon May 9 10:27:21 2016 +0300

----------------------------------------------------------------------
 mpin-sdk-core                                   |  2 +-
 .../main/java/com/miracl/mpinsdk/MPinSDK.java   | 30 ++++++-
 mpinsdk/src/main/jni/JNIMPinSDK.cpp             | 90 +++++++++++++++++---
 3 files changed, 106 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/f914e067/mpin-sdk-core
----------------------------------------------------------------------
diff --git a/mpin-sdk-core b/mpin-sdk-core
index 441caba..58448b9 160000
--- a/mpin-sdk-core
+++ b/mpin-sdk-core
@@ -1 +1 @@
-Subproject commit 441cabaa96a916db82ae9c5a092336117b703196
+Subproject commit 58448b9b6a1a05e8f5f662bd6c34a0192dca43c8

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/f914e067/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
----------------------------------------------------------------------
diff --git a/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java b/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
index 15e8eb3..3077eb5 100644
--- a/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
+++ b/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
@@ -117,6 +117,10 @@ public class MPinSDK implements Closeable {
         return nStartAuthentication(mPtr, user);
     }
 
+    public Status StartAuthentication(User user, String accessCode) {
+        return nStartAuthenticationAccessCode(mPtr, user, accessCode);
+    }
+
     public Status CheckAccessNumber(String accessNumber) {
         return nCheckAccessNumber(mPtr, accessNumber);
     }
@@ -137,12 +141,24 @@ public class MPinSDK implements Closeable {
         return nFinishAuthenticationAN(mPtr, user, pin, accessNumber);
     }
 
+    public String GetPrerollUserId(String accessCode) {
+        return nGetPrerollUserId(mPtr, accessCode);
+    }
+
     public void DeleteUser(User user) {
         nDeleteUser(mPtr, user);
     }
 
-    public void ListUsers(List<User> users) {
-        nListUsers(mPtr, users);
+    public Status ListUsers(List<User> users) {
+        return nListUsers(mPtr, users);
+    }
+
+    public Status ListUsers(List<User> users, String backend) {
+        return nListUsersForBackend(mPtr, users, backend);
+    }
+
+    public Status ListBackends(List<String> backends) {
+        return nListBackends(mPtr, backends);
     }
 
     public String GetVersion() {
@@ -187,6 +203,8 @@ public class MPinSDK implements Closeable {
 
     private native Status nStartAuthentication(long ptr, User user);
 
+    private native Status nStartAuthenticationAccessCode(long ptr, User user, String accessCode);
+
     private native Status nCheckAccessNumber(long ptr, String accessNumber);
 
     private native Status nFinishAuthentication(long ptr, User user, String pin);
@@ -197,9 +215,15 @@ public class MPinSDK implements Closeable {
 
     private native Status nFinishAuthenticationAN(long ptr, User user, String pin, String accessNumber);
 
+    private native String nGetPrerollUserId(long ptr, String key);
+
     private native void nDeleteUser(long ptr, User user);
 
-    private native void nListUsers(long ptr, List<User> users);
+    private native Status nListUsers(long ptr, List<User> users);
+
+    private native Status nListUsersForBackend(long ptr, List<User> users, String backend);
+
+    private native Status nListBackends(long ptr, List<String> backends);
 
     private native String nGetVersion(long ptr);
 

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/f914e067/mpinsdk/src/main/jni/JNIMPinSDK.cpp
----------------------------------------------------------------------
diff --git a/mpinsdk/src/main/jni/JNIMPinSDK.cpp b/mpinsdk/src/main/jni/JNIMPinSDK.cpp
index 7537d8d..4f684b3 100644
--- a/mpinsdk/src/main/jni/JNIMPinSDK.cpp
+++ b/mpinsdk/src/main/jni/JNIMPinSDK.cpp
@@ -118,6 +118,12 @@ static jobject nStartAuthentication(JNIEnv* env, jobject jobj, jlong jptr, jobje
 	return MakeJavaStatus(env, sdk->StartAuthentication(JavaToMPinUser(env, juser)));
 }
 
+static jobject nStartAuthenticationAccessCode(JNIEnv* env, jobject jobj, jlong jptr, jobject juser, jstring accessCode)
+{
+    MPinSDK* sdk = (MPinSDK*) jptr;
+    return MakeJavaStatus(env, sdk->StartAuthentication(JavaToMPinUser(env, juser),JavaToStdString(env,accessCode)));
+}
+
 static jobject nCheckAccessNumber(JNIEnv* env, jobject jobj, jlong jptr, jstring jaccessNumber)
 {
 	MPinSDK* sdk = (MPinSDK*) jptr;
@@ -177,29 +183,85 @@ static jobject nFinishAuthenticationAN(JNIEnv* env, jobject jobj, jlong jptr, jo
 	return MakeJavaStatus(env, sdk->FinishAuthenticationAN(JavaToMPinUser(env, juser), JavaToStdString(env, jpin), JavaToStdString(env, jaccessNumber)));
 }
 
+static jstring nGetPrerollUserId(JNIEnv* env, jobject jobj, jlong jptr, jstring jaccessCode)
+{
+    MPinSDK* sdk = (MPinSDK*) jptr;
+    MPinSDK::String result = sdk->GetPrerollUserId(JavaToStdString(env, jaccessCode));
+    return env->NewStringUTF(result.c_str());
+}
+
 static void nDeleteUser(JNIEnv* env, jobject jobj, jlong jptr, jobject juser)
 {
 	MPinSDK* sdk = (MPinSDK*) jptr;
 	sdk->DeleteUser(JavaToMPinUser(env, juser));
 }
 
-static void nListUsers(JNIEnv* env, jobject jobj, jlong jptr, jobject jusersList)
+static jobject nListUsers(JNIEnv* env, jobject jobj, jlong jptr, jobject jusersList)
 {
 	MPinSDK* sdk = (MPinSDK*) jptr;
 	std::vector<MPinSDK::UserPtr> users;
-	sdk->ListUsers(users);
+	MPinSDK::Status status = sdk->ListUsers(users);
 
-	jclass clsList = env->FindClass("java/util/List");
-	jmethodID midAdd = env->GetMethodID(clsList, "add", "(Ljava/lang/Object;)Z");
+    if(status == MPinSDK::Status::OK)
+    {
+        jclass clsList = env->FindClass("java/util/List");
+        jmethodID midAdd = env->GetMethodID(clsList, "add", "(Ljava/lang/Object;)Z");
 
-	jclass clsUser = env->FindClass("com/miracl/mpinsdk/model/User");
-	jmethodID ctorUser = env->GetMethodID(clsUser, "<init>", "(J)V");
+        jclass clsUser = env->FindClass("com/miracl/mpinsdk/model/User");
+        jmethodID ctorUser = env->GetMethodID(clsUser, "<init>", "(J)V");
 
-	for (std::vector<MPinSDK::UserPtr>::iterator i = users.begin(); i != users.end(); ++i) {
-		MPinSDK::UserPtr user = *i;
-		jobject juser = env->NewObject(clsUser, ctorUser, (jlong) new MPinSDK::UserPtr(user));
-		env->CallBooleanMethod(jusersList, midAdd, juser);
-	}
+        for (std::vector<MPinSDK::UserPtr>::iterator i = users.begin(); i != users.end(); ++i) {
+            MPinSDK::UserPtr user = *i;
+            jobject juser = env->NewObject(clsUser, ctorUser, (jlong) new MPinSDK::UserPtr(user));
+            env->CallBooleanMethod(jusersList, midAdd, juser);
+        }
+    }
+
+    return MakeJavaStatus(env,status);
+}
+
+static jobject nListUsersForBackend(JNIEnv* env, jobject jobj, jlong jptr, jobject jusersList, jstring jbackend)
+{
+    MPinSDK* sdk = (MPinSDK*) jptr;
+    std::vector<MPinSDK::UserPtr> users;
+    MPinSDK::Status status = sdk->ListUsers(users,JavaToStdString(env,jbackend));
+
+    if(status == MPinSDK::Status::OK)
+    {
+        jclass clsList = env->FindClass("java/util/List");
+        jmethodID midAdd = env->GetMethodID(clsList, "add", "(Ljava/lang/Object;)Z");
+
+        jclass clsUser = env->FindClass("com/miracl/mpinsdk/model/User");
+        jmethodID ctorUser = env->GetMethodID(clsUser, "<init>", "(J)V");
+
+        for (std::vector<MPinSDK::UserPtr>::iterator i = users.begin(); i != users.end(); ++i) {
+            MPinSDK::UserPtr user = *i;
+            jobject juser = env->NewObject(clsUser, ctorUser, (jlong) new MPinSDK::UserPtr(user));
+            env->CallBooleanMethod(jusersList, midAdd, juser);
+        }
+    }
+
+    return MakeJavaStatus(env,status);
+}
+
+static jobject nListBackends(JNIEnv* env, jobject jobj, jlong jptr,jobject jBackendsList)
+{
+    MPinSDK* sdk = (MPinSDK*) jptr;
+    std::vector<MPinSDK::String> backends;
+    MPinSDK::Status status = sdk->ListBackends(backends);
+
+    if(status == MPinSDK::Status::OK)
+    {
+        jclass clsList = env->FindClass("java/util/List");
+        jmethodID midAdd = env->GetMethodID(clsList, "add", "(Ljava/lang/Object;)Z");
+
+        for (std::vector<MPinSDK::String>::iterator i = backends.begin(); i != backends.end(); ++i) {
+            MPinSDK::String backend = *i;
+            env->CallBooleanMethod(jBackendsList, midAdd, env->NewStringUTF(backend.c_str()));
+        }
+    }
+
+    return MakeJavaStatus(env,status);
 }
 
 static jstring nGetVersion(JNIEnv* env, jobject jobj, jlong jptr)
@@ -243,13 +305,17 @@ static JNINativeMethod g_methodsMPinSDK[] =
 	NATIVE_METHOD(nConfirmRegistration, "(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nFinishRegistration, "(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nStartAuthentication, "(JLcom/miracl/mpinsdk/model/User;)Lcom/miracl/mpinsdk/model/Status;"),
+    NATIVE_METHOD(nStartAuthenticationAccessCode, "(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nCheckAccessNumber, "(JLjava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nFinishAuthentication, "(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nFinishAuthenticationResultData, "(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;Ljava/lang/StringBuilder;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nFinishAuthenticationOTP, "(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;Lcom/miracl/mpinsdk/model/OTP;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nFinishAuthenticationAN, "(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;Ljava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nDeleteUser, "(JLcom/miracl/mpinsdk/model/User;)V"),
-	NATIVE_METHOD(nListUsers, "(JLjava/util/List;)V"),
+    NATIVE_METHOD(nGetPrerollUserId, "(JLjava/lang/String;)Ljava/lang/String;"),
+	NATIVE_METHOD(nListUsers, "(JLjava/util/List;)Lcom/miracl/mpinsdk/model/Status;"),
+    NATIVE_METHOD(nListUsersForBackend, "(JLjava/util/List;Ljava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
+    NATIVE_METHOD(nListBackends, "(JLjava/util/List;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nGetVersion, "(J)Ljava/lang/String;"),
 	NATIVE_METHOD(nCanLogout, "(JLcom/miracl/mpinsdk/model/User;)Z"),
 	NATIVE_METHOD(nLogout, "(JLcom/miracl/mpinsdk/model/User;)Z"),


[07/10] incubator-milagro-mfa-sdk-android 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-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/commit/d3543e2b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/tree/d3543e2b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/diff/d3543e2b

Branch: refs/heads/master
Commit: d3543e2be0922346064366b7dc79eec60d33755b
Parents: ff6bb04
Author: Simeon Aladjem <si...@miracl.com>
Authored: Sat Sep 10 17:11:36 2016 +0300
Committer: Simeon Aladjem <si...@miracl.com>
Committed: Sat Sep 10 17:11:36 2016 +0300

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


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/d3543e2b/.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


[06/10] incubator-milagro-mfa-sdk-android git commit: Add new network error codes in Status

Posted by sa...@apache.org.
Add new network error codes in Status

	Update the gradle wrapper to 2.14.1


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

Branch: refs/heads/master
Commit: ff6bb04c2a1a81b61b91b53cc3da7fbd4946616c
Parents: 3e323a0
Author: Vassil Angelov <va...@miracl.com>
Authored: Fri Sep 9 15:51:58 2016 +0300
Committer: Vassil Angelov <va...@miracl.com>
Committed: Fri Sep 9 15:51:58 2016 +0300

----------------------------------------------------------------------
 gradle.properties                                          | 2 +-
 gradle/wrapper/gradle-wrapper.properties                   | 4 ++--
 mpin-sdk-core                                              | 2 +-
 mpinsdk/src/main/java/com/miracl/mpinsdk/model/Status.java | 5 +++--
 4 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/ff6bb04c/gradle.properties
----------------------------------------------------------------------
diff --git a/gradle.properties b/gradle.properties
index a291823..eb2384a 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -16,7 +16,7 @@
 # This option should only be used with decoupled projects. More details, visit
 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
 # org.gradle.parallel=true
-VERSION_NAME=1.2-SNAPSHOT
+VERSION_NAME=1.3-SNAPSHOT
 GROUP=com.miracl
 RELEASE_REPOSITORY_URL=http://10.10.23.15:8081/content/repositories/mpinsdk/
 SNAPSHOT_REPOSITORY_URL=http://10.10.23.15:8081/content/repositories/mpinsdk-snapshot/

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/ff6bb04c/gradle/wrapper/gradle-wrapper.properties
----------------------------------------------------------------------
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 330e95a..fef85ea 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Wed Oct 21 11:34:03 PDT 2015
+#Fri Sep 09 15:34:14 EEST 2016
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/ff6bb04c/mpin-sdk-core
----------------------------------------------------------------------
diff --git a/mpin-sdk-core b/mpin-sdk-core
index a17c6b3..e631fb2 160000
--- a/mpin-sdk-core
+++ b/mpin-sdk-core
@@ -1 +1 @@
-Subproject commit a17c6b3d45aa2e952fa499dca5d193467d485486
+Subproject commit e631fb2db35485114e6628abee12a28989e35cff

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/ff6bb04c/mpinsdk/src/main/java/com/miracl/mpinsdk/model/Status.java
----------------------------------------------------------------------
diff --git a/mpinsdk/src/main/java/com/miracl/mpinsdk/model/Status.java b/mpinsdk/src/main/java/com/miracl/mpinsdk/model/Status.java
index 4d2bb52..de9a477 100644
--- a/mpinsdk/src/main/java/com/miracl/mpinsdk/model/Status.java
+++ b/mpinsdk/src/main/java/com/miracl/mpinsdk/model/Status.java
@@ -67,8 +67,9 @@ public class Status implements Serializable {
         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
+        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
     }
-
 }


[05/10] incubator-milagro-mfa-sdk-android git commit: Apply MPinSdk API changes

Posted by sa...@apache.org.
Apply MPinSdk API changes

	Remove DeleteUserForBackend
	Add InitWithCustomHeaders
	Add ListAllUsers
	Add GetBackend for a User
	Update build tools and gradle plugin version


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

Branch: refs/heads/master
Commit: 3e323a0a161807f020055fe63e3955917e8f49f4
Parents: 2f8b253
Author: Vassil Angelov <va...@miracl.com>
Authored: Thu Jul 14 14:12:33 2016 +0300
Committer: Vassil Angelov <va...@miracl.com>
Committed: Thu Jul 14 14:31:37 2016 +0300

----------------------------------------------------------------------
 build.gradle                                    |  2 +-
 gradle.properties                               |  2 +-
 mpin-sdk-core                                   |  2 +-
 mpinsdk/build.gradle                            |  2 +-
 .../main/java/com/miracl/mpinsdk/MPinSDK.java   | 19 +++--
 .../java/com/miracl/mpinsdk/model/User.java     | 40 ++++-----
 mpinsdk/src/main/jni/JNIMPinSDK.cpp             | 85 +++++++++++++-------
 mpinsdk/src/main/jni/JNIUser.cpp                |  8 +-
 8 files changed, 102 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/3e323a0a/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 168f129..aff4f41 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,7 +5,7 @@ buildscript {
         jcenter()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:2.0.0'
+        classpath 'com.android.tools.build:gradle:2.1.2'
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/3e323a0a/gradle.properties
----------------------------------------------------------------------
diff --git a/gradle.properties b/gradle.properties
index 78806a8..a291823 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -16,7 +16,7 @@
 # This option should only be used with decoupled projects. More details, visit
 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
 # org.gradle.parallel=true
-VERSION_NAME=1.1
+VERSION_NAME=1.2-SNAPSHOT
 GROUP=com.miracl
 RELEASE_REPOSITORY_URL=http://10.10.23.15:8081/content/repositories/mpinsdk/
 SNAPSHOT_REPOSITORY_URL=http://10.10.23.15:8081/content/repositories/mpinsdk-snapshot/

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/3e323a0a/mpin-sdk-core
----------------------------------------------------------------------
diff --git a/mpin-sdk-core b/mpin-sdk-core
index 0c9b7fa..a17c6b3 160000
--- a/mpin-sdk-core
+++ b/mpin-sdk-core
@@ -1 +1 @@
-Subproject commit 0c9b7fa6256ad4b2b90a14ce3ce7aabfbe6c16f6
+Subproject commit a17c6b3d45aa2e952fa499dca5d193467d485486

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/3e323a0a/mpinsdk/build.gradle
----------------------------------------------------------------------
diff --git a/mpinsdk/build.gradle b/mpinsdk/build.gradle
index ff85523..9556f3b 100644
--- a/mpinsdk/build.gradle
+++ b/mpinsdk/build.gradle
@@ -4,7 +4,7 @@ import org.apache.tools.ant.taskdefs.condition.Os
 
 android {
     compileSdkVersion 23
-    buildToolsVersion "23.0.2"
+    buildToolsVersion "23.0.3"
 
     defaultConfig {
         minSdkVersion 16

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/3e323a0a/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
----------------------------------------------------------------------
diff --git a/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java b/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
index 6eddc3e..f94f970 100644
--- a/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
+++ b/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
@@ -58,6 +58,10 @@ public class MPinSDK implements Closeable {
         return nInit(mPtr, config, context);
     }
 
+    public Status Init(Map<String, String> config, Context context, Map<String, String> customHeaders) {
+        return nInitWithCustomHeaders(mPtr, config, context, customHeaders);
+    }
+
     public Status TestBackend(String server) {
         return nTestBackend(mPtr, server);
     }
@@ -150,14 +154,14 @@ public class MPinSDK implements Closeable {
         nDeleteUser(mPtr, user);
     }
 
-    public void DeleteUser(User user, String backend) {
-        nDeleteUserForBackend(mPtr, user, backend);
-    }
-
     public Status ListUsers(List<User> users) {
         return nListUsers(mPtr, users);
     }
 
+    public Status ListAllUsers(List<User> users) {
+        return nListAllUsers(mPtr, users);
+    }
+
     public Status ListUsers(List<User> users, String backend) {
         return nListUsersForBackend(mPtr, users, backend);
     }
@@ -188,6 +192,9 @@ public class MPinSDK implements Closeable {
 
     private native Status nInit(long ptr, Map<String, String> config, Context context);
 
+    private native Status nInitWithCustomHeaders(long ptr, Map<String, String> config, Context context,
+                                                 Map<String, String> customHeaders);
+
     private native Status nTestBackend(long ptr, String server);
 
     private native Status nTestBackendRPS(long ptr, String server, String rpsPrefix);
@@ -224,10 +231,10 @@ public class MPinSDK implements Closeable {
 
     private native void nDeleteUser(long ptr, User user);
 
-    private native void nDeleteUserForBackend(long ptr, User user, String backend);
-
     private native Status nListUsers(long ptr, List<User> users);
 
+    private native Status nListAllUsers(long ptr, List<User> users);
+
     private native Status nListUsersForBackend(long ptr, List<User> users, String backend);
 
     private native Status nListBackends(long ptr, List<String> backends);

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/3e323a0a/mpinsdk/src/main/java/com/miracl/mpinsdk/model/User.java
----------------------------------------------------------------------
diff --git a/mpinsdk/src/main/java/com/miracl/mpinsdk/model/User.java b/mpinsdk/src/main/java/com/miracl/mpinsdk/model/User.java
index ca6dc15..2f48a07 100644
--- a/mpinsdk/src/main/java/com/miracl/mpinsdk/model/User.java
+++ b/mpinsdk/src/main/java/com/miracl/mpinsdk/model/User.java
@@ -24,22 +24,14 @@ import java.io.Closeable;
 
 public class User implements Closeable {
 
-    private boolean isUserSelected;
-
-    private long mPtr;
-
-
-    private User(long ptr) {
-        mPtr = ptr;
+    public enum State {
+        INVALID, STARTED_REGISTRATION, ACTIVATED, REGISTERED, BLOCKED
     }
 
-    private native void nDestruct(long ptr);
-
-    private native String nGetId(long ptr);
+    private boolean isUserSelected;
 
-    private native int nGetState(long ptr);
+    private long mPtr;
 
-    ;
 
     public String getId() {
         return nGetId(mPtr);
@@ -60,6 +52,15 @@ public class User implements Closeable {
         }
     }
 
+    public boolean isUserSelected() {
+        return isUserSelected;
+    }
+
+    public void setUserSelected(boolean isUserSelected) {
+        this.isUserSelected = isUserSelected;
+    }
+
+
     @Override
     public void close() {
         synchronized (this) {
@@ -79,17 +80,16 @@ public class User implements Closeable {
         return getId();
     }
 
-    public boolean isUserSelected() {
-        return isUserSelected;
-    }
 
-    public void setUserSelected(boolean isUserSelected) {
-        this.isUserSelected = isUserSelected;
+    private User(long ptr) {
+        mPtr = ptr;
     }
 
+    private native void nDestruct(long ptr);
 
-    public enum State {
-        INVALID, STARTED_REGISTRATION, ACTIVATED, REGISTERED, BLOCKED
-    }
+    private native String nGetId(long ptr);
+
+    private native int nGetState(long ptr);
 
+    private native String nGetBackend(long ptr);
 }

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/3e323a0a/mpinsdk/src/main/jni/JNIMPinSDK.cpp
----------------------------------------------------------------------
diff --git a/mpinsdk/src/main/jni/JNIMPinSDK.cpp b/mpinsdk/src/main/jni/JNIMPinSDK.cpp
index 3a06254..ace68df 100644
--- a/mpinsdk/src/main/jni/JNIMPinSDK.cpp
+++ b/mpinsdk/src/main/jni/JNIMPinSDK.cpp
@@ -49,6 +49,23 @@ static jobject nInit(JNIEnv* env, jobject jobj, jlong jptr, jobject jconfig, job
 	return MakeJavaStatus(env, sdk->Init(config, Context::Instance(jcontext)));
 }
 
+static jobject nInitWithCustomHeaders(JNIEnv* env, jobject jobj, jlong jptr, jobject jconfig, jobject jcontext, jobject jcustomHeaders)
+{
+	MPinSDK::StringMap config, customHeaders;
+	if(jconfig)
+	{
+		ReadJavaMap(env, jconfig, config);
+	}
+
+    if(jcustomHeaders)
+    {
+        ReadJavaMap(env, jcustomHeaders, customHeaders);
+    }
+
+	MPinSDK* sdk = (MPinSDK*) jptr;
+	return MakeJavaStatus(env, sdk->Init(config, Context::Instance(jcontext), customHeaders));
+}
+
 static jobject nTestBackend(JNIEnv* env, jobject jobj, jlong jptr, jstring jserver)
 {
 	MPinSDK* sdk = (MPinSDK*) jptr;
@@ -94,12 +111,6 @@ static jobject nRestartRegistration(JNIEnv* env, jobject jobj, jlong jptr, jobje
 	return MakeJavaStatus(env, sdk->RestartRegistration(JavaToMPinUser(env, juser), JavaToStdString(env, juserData)));
 }
 
-//static jobject nVerifyUser(JNIEnv* env, jobject jobj, jlong jptr, jobject juser, jstring jmpinId, jstring jactivationKey)
-//{
-//	MPinSDK* sdk = (MPinSDK*) jptr;
-//	return MakeJavaStatus(env, sdk->VerifyUser(JavaToMPinUser(env, juser), JavaToStdString(env, jmpinId), JavaToStdString(env, jactivationKey)));
-//}
-
 static jobject nConfirmRegistration(JNIEnv* env, jobject jobj, jlong jptr, jobject juser, jstring jpushMessageIdentifier)
 {
 	MPinSDK* sdk = (MPinSDK*) jptr;
@@ -210,11 +221,6 @@ static void nDeleteUser(JNIEnv* env, jobject jobj, jlong jptr, jobject juser)
 	sdk->DeleteUser(JavaToMPinUser(env, juser));
 }
 
-static void nDeleteUserForBackend(JNIEnv* env, jobject jobj, jlong jptr, jobject juser, jstring jbackend){
-    MPinSDK* sdk = (MPinSDK*) jptr;
-    sdk->DeleteUser(JavaToMPinUser(env, juser), JavaToStdString(env, jbackend));
-}
-
 static jobject nListUsers(JNIEnv* env, jobject jobj, jlong jptr, jobject jusersList)
 {
 	MPinSDK* sdk = (MPinSDK*) jptr;
@@ -242,25 +248,49 @@ static jobject nListUsers(JNIEnv* env, jobject jobj, jlong jptr, jobject jusersL
 static jobject nListUsersForBackend(JNIEnv* env, jobject jobj, jlong jptr, jobject jusersList, jstring jbackend)
 {
     MPinSDK* sdk = (MPinSDK*) jptr;
-    std::vector<MPinSDK::UserPtr> users;
-    MPinSDK::Status status = sdk->ListUsers(users,JavaToStdString(env,jbackend));
-
-    if(status == MPinSDK::Status::OK)
-    {
-        jclass clsList = env->FindClass("java/util/List");
-        jmethodID midAdd = env->GetMethodID(clsList, "add", "(Ljava/lang/Object;)Z");
+    	std::vector<MPinSDK::UserPtr> users;
+    	MPinSDK::Status status = sdk->ListAllUsers(users);
+
+        if(status == MPinSDK::Status::OK)
+        {
+            jclass clsList = env->FindClass("java/util/List");
+            jmethodID midAdd = env->GetMethodID(clsList, "add", "(Ljava/lang/Object;)Z");
+
+            jclass clsUser = env->FindClass("com/miracl/mpinsdk/model/User");
+            jmethodID ctorUser = env->GetMethodID(clsUser, "<init>", "(J)V");
+
+            for (std::vector<MPinSDK::UserPtr>::iterator i = users.begin(); i != users.end(); ++i) {
+                MPinSDK::UserPtr user = *i;
+                jobject juser = env->NewObject(clsUser, ctorUser, (jlong) new MPinSDK::UserPtr(user));
+                env->CallBooleanMethod(jusersList, midAdd, juser);
+            }
+        }
 
-        jclass clsUser = env->FindClass("com/miracl/mpinsdk/model/User");
-        jmethodID ctorUser = env->GetMethodID(clsUser, "<init>", "(J)V");
+        return MakeJavaStatus(env,status);
+}
 
-        for (std::vector<MPinSDK::UserPtr>::iterator i = users.begin(); i != users.end(); ++i) {
-            MPinSDK::UserPtr user = *i;
-            jobject juser = env->NewObject(clsUser, ctorUser, (jlong) new MPinSDK::UserPtr(user));
-            env->CallBooleanMethod(jusersList, midAdd, juser);
+static jobject nListAllUsers(JNIEnv* env, jobject jobj, jlong jptr, jobject jusersList)
+{
+        MPinSDK* sdk = (MPinSDK*) jptr;
+        std::vector<MPinSDK::UserPtr> users;
+        MPinSDK::Status status = sdk->ListAllUsers(users);
+
+        if(status == MPinSDK::Status::OK)
+        {
+            jclass clsList = env->FindClass("java/util/List");
+            jmethodID midAdd = env->GetMethodID(clsList, "add", "(Ljava/lang/Object;)Z");
+
+            jclass clsUser = env->FindClass("com/miracl/mpinsdk/model/User");
+            jmethodID ctorUser = env->GetMethodID(clsUser, "<init>", "(J)V");
+
+            for (std::vector<MPinSDK::UserPtr>::iterator i = users.begin(); i != users.end(); ++i) {
+                MPinSDK::UserPtr user = *i;
+                jobject juser = env->NewObject(clsUser, ctorUser, (jlong) new MPinSDK::UserPtr(user));
+                env->CallBooleanMethod(jusersList, midAdd, juser);
+            }
         }
-    }
 
-    return MakeJavaStatus(env,status);
+        return MakeJavaStatus(env,status);
 }
 
 static jobject nListBackends(JNIEnv* env, jobject jobj, jlong jptr,jobject jBackendsList)
@@ -314,6 +344,7 @@ static JNINativeMethod g_methodsMPinSDK[] =
 	NATIVE_METHOD(nConstruct, "()J"),
 	NATIVE_METHOD(nDestruct, "(J)V"),
 	NATIVE_METHOD(nInit, "(JLjava/util/Map;Landroid/content/Context;)Lcom/miracl/mpinsdk/model/Status;"),
+	NATIVE_METHOD(nInitWithCustomHeaders, "(JLjava/util/Map;Landroid/content/Context;Ljava/util/Map;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nTestBackend, "(JLjava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nTestBackendRPS, "(JLjava/lang/String;Ljava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nSetBackend, "(JLjava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
@@ -331,9 +362,9 @@ static JNINativeMethod g_methodsMPinSDK[] =
 	NATIVE_METHOD(nFinishAuthenticationOTP, "(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;Lcom/miracl/mpinsdk/model/OTP;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nFinishAuthenticationAN, "(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;Ljava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nDeleteUser, "(JLcom/miracl/mpinsdk/model/User;)V"),
-	NATIVE_METHOD(nDeleteUserForBackend, "(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;)V"),
 	NATIVE_METHOD(nGetSessionDetails, "(JLjava/lang/String;Lcom/miracl/mpinsdk/model/SessionDetails;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nListUsers, "(JLjava/util/List;)Lcom/miracl/mpinsdk/model/Status;"),
+	NATIVE_METHOD(nListAllUsers, "(JLjava/util/List;)Lcom/miracl/mpinsdk/model/Status;"),
     NATIVE_METHOD(nListUsersForBackend, "(JLjava/util/List;Ljava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
     NATIVE_METHOD(nListBackends, "(JLjava/util/List;)Lcom/miracl/mpinsdk/model/Status;"),
 	NATIVE_METHOD(nGetVersion, "(J)Ljava/lang/String;"),

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/3e323a0a/mpinsdk/src/main/jni/JNIUser.cpp
----------------------------------------------------------------------
diff --git a/mpinsdk/src/main/jni/JNIUser.cpp b/mpinsdk/src/main/jni/JNIUser.cpp
index ab66717..6c39c63 100644
--- a/mpinsdk/src/main/jni/JNIUser.cpp
+++ b/mpinsdk/src/main/jni/JNIUser.cpp
@@ -36,11 +36,17 @@ static jint nGetState(JNIEnv* env, jobject jobj, jlong jptr)
 	return (*((const MPinSDK::UserPtr*)jptr))->GetState();
 }
 
+static jstring nGetBackend(JNIEnv* env, jobject jobj, jlong jptr)
+{
+    return env->NewStringUTF( (*((const MPinSDK::UserPtr*)jptr))->GetBackend().c_str());
+}
+
 static JNINativeMethod g_methodsUser[] =
 {
 	NATIVE_METHOD(nDestruct, "(J)V"),
 	NATIVE_METHOD(nGetId, "(J)Ljava/lang/String;"),
-	NATIVE_METHOD(nGetState, "(J)I")
+	NATIVE_METHOD(nGetState, "(J)I"),
+	NATIVE_METHOD(nGetBackend, "(J)Ljava/lang/String;")
 };
 
 void RegisterUserJNI(JNIEnv* env)