summaryrefslogtreecommitdiffstats
path: root/base/common/src/org
diff options
context:
space:
mode:
authorChristina Fu <cfu@redhat.com>2014-05-08 10:04:22 -0700
committerChristina Fu <cfu@redhat.com>2014-05-13 09:34:45 -0700
commit7c1fc987bdd28b70eee1a5a0bf18c252bb31fa3f (patch)
tree8ee590f97b7aced5a87c167958ad948c22ad2a78 /base/common/src/org
parent504a01433b5a6a67f843d6ea1f85865212c53141 (diff)
downloadpki-7c1fc987bdd28b70eee1a5a0bf18c252bb31fa3f.tar.gz
pki-7c1fc987bdd28b70eee1a5a0bf18c252bb31fa3f.tar.xz
pki-7c1fc987bdd28b70eee1a5a0bf18c252bb31fa3f.zip
Ticket #879 TPS Rewrite: User Authentication Framework
This patch provides the framework that allows people to 1. write their own authentication plugins using the authentication plugin framework 2. map the authenticaiton credential from client side (e.g. ESC or alike) in both display language characters and numbers of credential parameters to the specified authentication plugin required parameters.
Diffstat (limited to 'base/common/src/org')
-rw-r--r--base/common/src/org/dogtagpki/tps/msg/ExtendedLoginRequest.java2
-rw-r--r--base/common/src/org/dogtagpki/tps/msg/ExtendedLoginResponse.java10
-rw-r--r--base/common/src/org/dogtagpki/tps/msg/TPSMessage.java10
3 files changed, 22 insertions, 0 deletions
diff --git a/base/common/src/org/dogtagpki/tps/msg/ExtendedLoginRequest.java b/base/common/src/org/dogtagpki/tps/msg/ExtendedLoginRequest.java
index dbc481688..77081654b 100644
--- a/base/common/src/org/dogtagpki/tps/msg/ExtendedLoginRequest.java
+++ b/base/common/src/org/dogtagpki/tps/msg/ExtendedLoginRequest.java
@@ -33,6 +33,8 @@ public class ExtendedLoginRequest extends TPSMessage {
put(INVALID_PWD_NAME, invalid_pw);
put(BLOCKED_NAME, blocked);
put(MSG_TYPE_NAME, msgTypeToInt(MsgType.MSG_EXTENDED_LOGIN_REQUEST));
+ put(TITLE_NAME, title);
+ put (DESCRIPTION_NAME, description);
this.params = params;
}
diff --git a/base/common/src/org/dogtagpki/tps/msg/ExtendedLoginResponse.java b/base/common/src/org/dogtagpki/tps/msg/ExtendedLoginResponse.java
index 8ae7ad66a..29e9b72af 100644
--- a/base/common/src/org/dogtagpki/tps/msg/ExtendedLoginResponse.java
+++ b/base/common/src/org/dogtagpki/tps/msg/ExtendedLoginResponse.java
@@ -32,6 +32,16 @@ public class ExtendedLoginResponse extends TPSMessage {
//ToDo process the actual params
}
+ public ExtendedLoginResponse(OpType theOp, String uid, String password, Map<String, String> theExtensions) {
+
+ put(OPERATION_TYPE_NAME, opTypeToInt(theOp));
+ put(MSG_TYPE_NAME, msgTypeToInt(MsgType.MSG_EXTENDED_LOGIN_RESPONSE));
+ authParams = theExtensions;
+ put(SCREEN_NAME_NAME, uid);
+ put(PASSWORD_NAME, password);
+
+ }
+
public static void main(String[] args) {
}
diff --git a/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java b/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java
index c6e7cf7a7..39af93c7d 100644
--- a/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java
+++ b/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java
@@ -69,6 +69,8 @@ public class TPSMessage {
public static final String SCREEN_NAME_NAME = "screen_name";
public static final String PASSWORD_NAME = "password";
public static final String PIN_REQUIRED_NAME = "pin_required";
+ public static final String TITLE_NAME = "title";
+ public static final String DESCRIPTION_NAME = "description";
public static final String NEXT_VALUE_NAME = "next_value";
public static final String VALUE_NAME = "value";
public static final String PIN_NAME = "pin";
@@ -451,10 +453,18 @@ public class TPSMessage {
case MSG_EXTENDED_LOGIN_REQUEST:
break;
case MSG_EXTENDED_LOGIN_RESPONSE:
+ result =
+ new ExtendedLoginResponse(op_val,
+ get(SCREEN_NAME_NAME),
+ get(PASSWORD_NAME),
+ extsMap);
break;
case MSG_LOGIN_REQUEST:
break;
case MSG_LOGIN_RESPONSE:
+ result =
+ new LoginResponse(get(SCREEN_NAME_NAME),
+ get(PASSWORD_NAME));
break;
case MSG_NEW_PIN_REQUEST:
break;