fixing portal user not set error

Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/c7400a91
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/c7400a91
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/c7400a91

Branch: refs/heads/develop
Commit: c7400a915da830c5736ae1acd9e423e1cc23c72d
Parents: 421a441
Author: scnakandala <[email protected]>
Authored: Sun May 1 21:26:58 2016 -0400
Committer: scnakandala <[email protected]>
Committed: Sun May 1 21:26:58 2016 -0400

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   |   7 +-
 .../java/org/apache/airavata/api/Airavata.java  | 258 ++++++++++++------
 .../main/resources/lib/airavata/Airavata.cpp    |  59 ++--
 .../src/main/resources/lib/airavata/Airavata.h  |  41 +--
 .../lib/airavata/Airavata_server.skeleton.cpp   |   9 +-
 .../resources/lib/Airavata/API/Airavata.php     |  59 ++--
 .../lib/apache/airavata/api/Airavata-remote     |   8 +-
 .../lib/apache/airavata/api/Airavata.py         |  68 +++--
 .../server/CredentialStoreServerHandler.java    |   6 +-
 .../store/datamodel/PasswordCredential.java     | 268 ++++++++++++-------
 .../airavata-apis/airavata_api.thrift           |   9 +-
 .../credential_store_data_models.thrift         |  11 +-
 12 files changed, 542 insertions(+), 261 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/c7400a91/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git 
a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
 
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index 4b6d2f3..b965858 100644
--- 
a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ 
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -419,17 +419,18 @@ public class AiravataServerHandler implements 
Airavata.Iface {
      * belonging to a Gateway.
      */
     @Override
-    public String registerPwdCredential(AuthzToken authzToken, String 
gatewayId, String userName, String password) throws InvalidRequestException, 
AiravataClientException, AiravataSystemException, TException {
+    public String registerPwdCredential(AuthzToken authzToken, String 
gatewayId, String portalUserName, String loginUserName, String password) throws 
InvalidRequestException, AiravataClientException, AiravataSystemException, 
TException {
         try {
             if (csClient == null){
                 csClient = getCredentialStoreServiceClient();
             }
             PasswordCredential pwdCredential = new PasswordCredential();
-            pwdCredential.setUsername(userName);
+            pwdCredential.setPortalUserName(portalUserName);
+            pwdCredential.setLoginUserName(loginUserName);
             pwdCredential.setPassword(password);
             pwdCredential.setGatewayId(gatewayId);
             String key = csClient.addPasswordCredential(pwdCredential);
-            logger.debug("Airavata generated PWD credential for gateway : " + 
gatewayId + " and for user : " + userName);
+            logger.debug("Airavata generated PWD credential for gateway : " + 
gatewayId + " and for user : " + loginUserName);
             return key;
         }catch (Exception e){
             logger.error("Error occurred while registering PWD Credential", e);

http://git-wip-us.apache.org/repos/asf/airavata/blob/c7400a91/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
----------------------------------------------------------------------
diff --git 
a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
 
b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
index 3f31655..18def6e 100644
--- 
a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
+++ 
b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
@@ -220,10 +220,12 @@ public class Airavata {
      * @param gatewayId
      *    The identifier for the requested Gateway.
      * 
-     * @param userName
+     * @param portalUserName
      *    The User for which the credential should be registered. For 
community accounts, this user is the name of the
      *    community user name. For computational resources, this user name 
need not be the same user name on resoruces.
      * 
+     * @param loginUserName
+     * 
      * @param password
      * 
      * @return airavataCredStoreToken
@@ -234,10 +236,11 @@ public class Airavata {
      * 
      * @param authzToken
      * @param gatewayId
-     * @param userName
+     * @param portalUserName
+     * @param loginUserName
      * @param password
      */
-    public String 
registerPwdCredential(org.apache.airavata.model.security.AuthzToken authzToken, 
String gatewayId, String userName, String password) throws 
org.apache.airavata.model.error.InvalidRequestException, 
org.apache.airavata.model.error.AiravataClientException, 
org.apache.airavata.model.error.AiravataSystemException, 
org.apache.thrift.TException;
+    public String 
registerPwdCredential(org.apache.airavata.model.security.AuthzToken authzToken, 
String gatewayId, String portalUserName, String loginUserName, String password) 
throws org.apache.airavata.model.error.InvalidRequestException, 
org.apache.airavata.model.error.AiravataClientException, 
org.apache.airavata.model.error.AiravataSystemException, 
org.apache.thrift.TException;
 
     /**
      * Get a Public Key by Providing the Token
@@ -2732,7 +2735,7 @@ public class Airavata {
 
     public void 
generateAndRegisterSSHKeys(org.apache.airavata.model.security.AuthzToken 
authzToken, String gatewayId, String userName, 
org.apache.thrift.async.AsyncMethodCallback resultHandler) throws 
org.apache.thrift.TException;
 
-    public void 
registerPwdCredential(org.apache.airavata.model.security.AuthzToken authzToken, 
String gatewayId, String userName, String password, 
org.apache.thrift.async.AsyncMethodCallback resultHandler) throws 
org.apache.thrift.TException;
+    public void 
registerPwdCredential(org.apache.airavata.model.security.AuthzToken authzToken, 
String gatewayId, String portalUserName, String loginUserName, String password, 
org.apache.thrift.async.AsyncMethodCallback resultHandler) throws 
org.apache.thrift.TException;
 
     public void getSSHPubKey(org.apache.airavata.model.security.AuthzToken 
authzToken, String airavataCredStoreToken, String gatewayId, 
org.apache.thrift.async.AsyncMethodCallback resultHandler) throws 
org.apache.thrift.TException;
 
@@ -3521,18 +3524,19 @@ public class Airavata {
       throw new 
org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT,
 "generateAndRegisterSSHKeys failed: unknown result");
     }
 
-    public String 
registerPwdCredential(org.apache.airavata.model.security.AuthzToken authzToken, 
String gatewayId, String userName, String password) throws 
org.apache.airavata.model.error.InvalidRequestException, 
org.apache.airavata.model.error.AiravataClientException, 
org.apache.airavata.model.error.AiravataSystemException, 
org.apache.thrift.TException
+    public String 
registerPwdCredential(org.apache.airavata.model.security.AuthzToken authzToken, 
String gatewayId, String portalUserName, String loginUserName, String password) 
throws org.apache.airavata.model.error.InvalidRequestException, 
org.apache.airavata.model.error.AiravataClientException, 
org.apache.airavata.model.error.AiravataSystemException, 
org.apache.thrift.TException
     {
-      send_registerPwdCredential(authzToken, gatewayId, userName, password);
+      send_registerPwdCredential(authzToken, gatewayId, portalUserName, 
loginUserName, password);
       return recv_registerPwdCredential();
     }
 
-    public void 
send_registerPwdCredential(org.apache.airavata.model.security.AuthzToken 
authzToken, String gatewayId, String userName, String password) throws 
org.apache.thrift.TException
+    public void 
send_registerPwdCredential(org.apache.airavata.model.security.AuthzToken 
authzToken, String gatewayId, String portalUserName, String loginUserName, 
String password) throws org.apache.thrift.TException
     {
       registerPwdCredential_args args = new registerPwdCredential_args();
       args.setAuthzToken(authzToken);
       args.setGatewayId(gatewayId);
-      args.setUserName(userName);
+      args.setPortalUserName(portalUserName);
+      args.setLoginUserName(loginUserName);
       args.setPassword(password);
       sendBase("registerPwdCredential", args);
     }
@@ -8927,9 +8931,9 @@ public class Airavata {
       }
     }
 
-    public void 
registerPwdCredential(org.apache.airavata.model.security.AuthzToken authzToken, 
String gatewayId, String userName, String password, 
org.apache.thrift.async.AsyncMethodCallback resultHandler) throws 
org.apache.thrift.TException {
+    public void 
registerPwdCredential(org.apache.airavata.model.security.AuthzToken authzToken, 
String gatewayId, String portalUserName, String loginUserName, String password, 
org.apache.thrift.async.AsyncMethodCallback resultHandler) throws 
org.apache.thrift.TException {
       checkReady();
-      registerPwdCredential_call method_call = new 
registerPwdCredential_call(authzToken, gatewayId, userName, password, 
resultHandler, this, ___protocolFactory, ___transport);
+      registerPwdCredential_call method_call = new 
registerPwdCredential_call(authzToken, gatewayId, portalUserName, 
loginUserName, password, resultHandler, this, ___protocolFactory, ___transport);
       this.___currentMethod = method_call;
       ___manager.call(method_call);
     }
@@ -8937,13 +8941,15 @@ public class Airavata {
     public static class registerPwdCredential_call extends 
org.apache.thrift.async.TAsyncMethodCall {
       private org.apache.airavata.model.security.AuthzToken authzToken;
       private String gatewayId;
-      private String userName;
+      private String portalUserName;
+      private String loginUserName;
       private String password;
-      public 
registerPwdCredential_call(org.apache.airavata.model.security.AuthzToken 
authzToken, String gatewayId, String userName, String password, 
org.apache.thrift.async.AsyncMethodCallback resultHandler, 
org.apache.thrift.async.TAsyncClient client, 
org.apache.thrift.protocol.TProtocolFactory protocolFactory, 
org.apache.thrift.transport.TNonblockingTransport transport) throws 
org.apache.thrift.TException {
+      public 
registerPwdCredential_call(org.apache.airavata.model.security.AuthzToken 
authzToken, String gatewayId, String portalUserName, String loginUserName, 
String password, org.apache.thrift.async.AsyncMethodCallback resultHandler, 
org.apache.thrift.async.TAsyncClient client, 
org.apache.thrift.protocol.TProtocolFactory protocolFactory, 
org.apache.thrift.transport.TNonblockingTransport transport) throws 
org.apache.thrift.TException {
         super(client, protocolFactory, transport, resultHandler, false);
         this.authzToken = authzToken;
         this.gatewayId = gatewayId;
-        this.userName = userName;
+        this.portalUserName = portalUserName;
+        this.loginUserName = loginUserName;
         this.password = password;
       }
 
@@ -8952,7 +8958,8 @@ public class Airavata {
         registerPwdCredential_args args = new registerPwdCredential_args();
         args.setAuthzToken(authzToken);
         args.setGatewayId(gatewayId);
-        args.setUserName(userName);
+        args.setPortalUserName(portalUserName);
+        args.setLoginUserName(loginUserName);
         args.setPassword(password);
         args.write(prot);
         prot.writeMessageEnd();
@@ -14532,7 +14539,7 @@ public class Airavata {
       public registerPwdCredential_result getResult(I iface, 
registerPwdCredential_args args) throws org.apache.thrift.TException {
         registerPwdCredential_result result = new 
registerPwdCredential_result();
         try {
-          result.success = iface.registerPwdCredential(args.authzToken, 
args.gatewayId, args.userName, args.password);
+          result.success = iface.registerPwdCredential(args.authzToken, 
args.gatewayId, args.portalUserName, args.loginUserName, args.password);
         } catch (org.apache.airavata.model.error.InvalidRequestException ire) {
           result.ire = ire;
         } catch (org.apache.airavata.model.error.AiravataClientException ace) {
@@ -19786,7 +19793,7 @@ public class Airavata {
       }
 
       public void start(I iface, registerPwdCredential_args args, 
org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws 
TException {
-        iface.registerPwdCredential(args.authzToken, args.gatewayId, 
args.userName, args.password,resultHandler);
+        iface.registerPwdCredential(args.authzToken, args.gatewayId, 
args.portalUserName, args.loginUserName, args.password,resultHandler);
       }
     }
 
@@ -47069,8 +47076,9 @@ public class Airavata {
 
     private static final org.apache.thrift.protocol.TField 
AUTHZ_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("authzToken", 
org.apache.thrift.protocol.TType.STRUCT, (short)1);
     private static final org.apache.thrift.protocol.TField 
GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", 
org.apache.thrift.protocol.TType.STRING, (short)2);
-    private static final org.apache.thrift.protocol.TField 
USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", 
org.apache.thrift.protocol.TType.STRING, (short)3);
-    private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC 
= new org.apache.thrift.protocol.TField("password", 
org.apache.thrift.protocol.TType.STRING, (short)4);
+    private static final org.apache.thrift.protocol.TField 
PORTAL_USER_NAME_FIELD_DESC = new 
org.apache.thrift.protocol.TField("portalUserName", 
org.apache.thrift.protocol.TType.STRING, (short)3);
+    private static final org.apache.thrift.protocol.TField 
LOGIN_USER_NAME_FIELD_DESC = new 
org.apache.thrift.protocol.TField("loginUserName", 
org.apache.thrift.protocol.TType.STRING, (short)4);
+    private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC 
= new org.apache.thrift.protocol.TField("password", 
org.apache.thrift.protocol.TType.STRING, (short)5);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes 
= new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
@@ -47080,15 +47088,17 @@ public class Airavata {
 
     public org.apache.airavata.model.security.AuthzToken authzToken; // 
required
     public String gatewayId; // required
-    public String userName; // required
+    public String portalUserName; // required
+    public String loginUserName; // required
     public String password; // required
 
     /** The set of fields this struct contains, along with convenience methods 
for finding and manipulating them. */
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       AUTHZ_TOKEN((short)1, "authzToken"),
       GATEWAY_ID((short)2, "gatewayId"),
-      USER_NAME((short)3, "userName"),
-      PASSWORD((short)4, "password");
+      PORTAL_USER_NAME((short)3, "portalUserName"),
+      LOGIN_USER_NAME((short)4, "loginUserName"),
+      PASSWORD((short)5, "password");
 
       private static final Map<String, _Fields> byName = new HashMap<String, 
_Fields>();
 
@@ -47107,9 +47117,11 @@ public class Airavata {
             return AUTHZ_TOKEN;
           case 2: // GATEWAY_ID
             return GATEWAY_ID;
-          case 3: // USER_NAME
-            return USER_NAME;
-          case 4: // PASSWORD
+          case 3: // PORTAL_USER_NAME
+            return PORTAL_USER_NAME;
+          case 4: // LOGIN_USER_NAME
+            return LOGIN_USER_NAME;
+          case 5: // PASSWORD
             return PASSWORD;
           default:
             return null;
@@ -47158,7 +47170,9 @@ public class Airavata {
           new 
org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
 org.apache.airavata.model.security.AuthzToken.class)));
       tmpMap.put(_Fields.GATEWAY_ID, new 
org.apache.thrift.meta_data.FieldMetaData("gatewayId", 
org.apache.thrift.TFieldRequirementType.REQUIRED, 
           new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-      tmpMap.put(_Fields.USER_NAME, new 
org.apache.thrift.meta_data.FieldMetaData("userName", 
org.apache.thrift.TFieldRequirementType.REQUIRED, 
+      tmpMap.put(_Fields.PORTAL_USER_NAME, new 
org.apache.thrift.meta_data.FieldMetaData("portalUserName", 
org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.LOGIN_USER_NAME, new 
org.apache.thrift.meta_data.FieldMetaData("loginUserName", 
org.apache.thrift.TFieldRequirementType.REQUIRED, 
           new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       tmpMap.put(_Fields.PASSWORD, new 
org.apache.thrift.meta_data.FieldMetaData("password", 
org.apache.thrift.TFieldRequirementType.REQUIRED, 
           new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
@@ -47172,13 +47186,15 @@ public class Airavata {
     public registerPwdCredential_args(
       org.apache.airavata.model.security.AuthzToken authzToken,
       String gatewayId,
-      String userName,
+      String portalUserName,
+      String loginUserName,
       String password)
     {
       this();
       this.authzToken = authzToken;
       this.gatewayId = gatewayId;
-      this.userName = userName;
+      this.portalUserName = portalUserName;
+      this.loginUserName = loginUserName;
       this.password = password;
     }
 
@@ -47192,8 +47208,11 @@ public class Airavata {
       if (other.isSetGatewayId()) {
         this.gatewayId = other.gatewayId;
       }
-      if (other.isSetUserName()) {
-        this.userName = other.userName;
+      if (other.isSetPortalUserName()) {
+        this.portalUserName = other.portalUserName;
+      }
+      if (other.isSetLoginUserName()) {
+        this.loginUserName = other.loginUserName;
       }
       if (other.isSetPassword()) {
         this.password = other.password;
@@ -47208,7 +47227,8 @@ public class Airavata {
     public void clear() {
       this.authzToken = null;
       this.gatewayId = null;
-      this.userName = null;
+      this.portalUserName = null;
+      this.loginUserName = null;
       this.password = null;
     }
 
@@ -47260,27 +47280,51 @@ public class Airavata {
       }
     }
 
-    public String getUserName() {
-      return this.userName;
+    public String getPortalUserName() {
+      return this.portalUserName;
     }
 
-    public registerPwdCredential_args setUserName(String userName) {
-      this.userName = userName;
+    public registerPwdCredential_args setPortalUserName(String portalUserName) 
{
+      this.portalUserName = portalUserName;
       return this;
     }
 
-    public void unsetUserName() {
-      this.userName = null;
+    public void unsetPortalUserName() {
+      this.portalUserName = null;
     }
 
-    /** Returns true if field userName is set (has been assigned a value) and 
false otherwise */
-    public boolean isSetUserName() {
-      return this.userName != null;
+    /** Returns true if field portalUserName is set (has been assigned a 
value) and false otherwise */
+    public boolean isSetPortalUserName() {
+      return this.portalUserName != null;
     }
 
-    public void setUserNameIsSet(boolean value) {
+    public void setPortalUserNameIsSet(boolean value) {
       if (!value) {
-        this.userName = null;
+        this.portalUserName = null;
+      }
+    }
+
+    public String getLoginUserName() {
+      return this.loginUserName;
+    }
+
+    public registerPwdCredential_args setLoginUserName(String loginUserName) {
+      this.loginUserName = loginUserName;
+      return this;
+    }
+
+    public void unsetLoginUserName() {
+      this.loginUserName = null;
+    }
+
+    /** Returns true if field loginUserName is set (has been assigned a value) 
and false otherwise */
+    public boolean isSetLoginUserName() {
+      return this.loginUserName != null;
+    }
+
+    public void setLoginUserNameIsSet(boolean value) {
+      if (!value) {
+        this.loginUserName = null;
       }
     }
 
@@ -47326,11 +47370,19 @@ public class Airavata {
         }
         break;
 
-      case USER_NAME:
+      case PORTAL_USER_NAME:
         if (value == null) {
-          unsetUserName();
+          unsetPortalUserName();
         } else {
-          setUserName((String)value);
+          setPortalUserName((String)value);
+        }
+        break;
+
+      case LOGIN_USER_NAME:
+        if (value == null) {
+          unsetLoginUserName();
+        } else {
+          setLoginUserName((String)value);
         }
         break;
 
@@ -47353,8 +47405,11 @@ public class Airavata {
       case GATEWAY_ID:
         return getGatewayId();
 
-      case USER_NAME:
-        return getUserName();
+      case PORTAL_USER_NAME:
+        return getPortalUserName();
+
+      case LOGIN_USER_NAME:
+        return getLoginUserName();
 
       case PASSWORD:
         return getPassword();
@@ -47374,8 +47429,10 @@ public class Airavata {
         return isSetAuthzToken();
       case GATEWAY_ID:
         return isSetGatewayId();
-      case USER_NAME:
-        return isSetUserName();
+      case PORTAL_USER_NAME:
+        return isSetPortalUserName();
+      case LOGIN_USER_NAME:
+        return isSetLoginUserName();
       case PASSWORD:
         return isSetPassword();
       }
@@ -47413,12 +47470,21 @@ public class Airavata {
           return false;
       }
 
-      boolean this_present_userName = true && this.isSetUserName();
-      boolean that_present_userName = true && that.isSetUserName();
-      if (this_present_userName || that_present_userName) {
-        if (!(this_present_userName && that_present_userName))
+      boolean this_present_portalUserName = true && this.isSetPortalUserName();
+      boolean that_present_portalUserName = true && that.isSetPortalUserName();
+      if (this_present_portalUserName || that_present_portalUserName) {
+        if (!(this_present_portalUserName && that_present_portalUserName))
           return false;
-        if (!this.userName.equals(that.userName))
+        if (!this.portalUserName.equals(that.portalUserName))
+          return false;
+      }
+
+      boolean this_present_loginUserName = true && this.isSetLoginUserName();
+      boolean that_present_loginUserName = true && that.isSetLoginUserName();
+      if (this_present_loginUserName || that_present_loginUserName) {
+        if (!(this_present_loginUserName && that_present_loginUserName))
+          return false;
+        if (!this.loginUserName.equals(that.loginUserName))
           return false;
       }
 
@@ -47448,10 +47514,15 @@ public class Airavata {
       if (present_gatewayId)
         list.add(gatewayId);
 
-      boolean present_userName = true && (isSetUserName());
-      list.add(present_userName);
-      if (present_userName)
-        list.add(userName);
+      boolean present_portalUserName = true && (isSetPortalUserName());
+      list.add(present_portalUserName);
+      if (present_portalUserName)
+        list.add(portalUserName);
+
+      boolean present_loginUserName = true && (isSetLoginUserName());
+      list.add(present_loginUserName);
+      if (present_loginUserName)
+        list.add(loginUserName);
 
       boolean present_password = true && (isSetPassword());
       list.add(present_password);
@@ -47489,12 +47560,22 @@ public class Airavata {
           return lastComparison;
         }
       }
-      lastComparison = 
Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
+      lastComparison = 
Boolean.valueOf(isSetPortalUserName()).compareTo(other.isSetPortalUserName());
       if (lastComparison != 0) {
         return lastComparison;
       }
-      if (isSetUserName()) {
-        lastComparison = 
org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
+      if (isSetPortalUserName()) {
+        lastComparison = 
org.apache.thrift.TBaseHelper.compareTo(this.portalUserName, 
other.portalUserName);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = 
Boolean.valueOf(isSetLoginUserName()).compareTo(other.isSetLoginUserName());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetLoginUserName()) {
+        lastComparison = 
org.apache.thrift.TBaseHelper.compareTo(this.loginUserName, 
other.loginUserName);
         if (lastComparison != 0) {
           return lastComparison;
         }
@@ -47545,11 +47626,19 @@ public class Airavata {
       }
       first = false;
       if (!first) sb.append(", ");
-      sb.append("userName:");
-      if (this.userName == null) {
+      sb.append("portalUserName:");
+      if (this.portalUserName == null) {
         sb.append("null");
       } else {
-        sb.append(this.userName);
+        sb.append(this.portalUserName);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("loginUserName:");
+      if (this.loginUserName == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.loginUserName);
       }
       first = false;
       if (!first) sb.append(", ");
@@ -47572,8 +47661,11 @@ public class Airavata {
       if (gatewayId == null) {
         throw new org.apache.thrift.protocol.TProtocolException("Required 
field 'gatewayId' was not present! Struct: " + toString());
       }
-      if (userName == null) {
-        throw new org.apache.thrift.protocol.TProtocolException("Required 
field 'userName' was not present! Struct: " + toString());
+      if (portalUserName == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required 
field 'portalUserName' was not present! Struct: " + toString());
+      }
+      if (loginUserName == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required 
field 'loginUserName' was not present! Struct: " + toString());
       }
       if (password == null) {
         throw new org.apache.thrift.protocol.TProtocolException("Required 
field 'password' was not present! Struct: " + toString());
@@ -47635,15 +47727,23 @@ public class Airavata {
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
               }
               break;
-            case 3: // USER_NAME
+            case 3: // PORTAL_USER_NAME
               if (schemeField.type == org.apache.thrift.protocol.TType.STRING) 
{
-                struct.userName = iprot.readString();
-                struct.setUserNameIsSet(true);
+                struct.portalUserName = iprot.readString();
+                struct.setPortalUserNameIsSet(true);
               } else { 
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
               }
               break;
-            case 4: // PASSWORD
+            case 4: // LOGIN_USER_NAME
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) 
{
+                struct.loginUserName = iprot.readString();
+                struct.setLoginUserNameIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
+              }
+              break;
+            case 5: // PASSWORD
               if (schemeField.type == org.apache.thrift.protocol.TType.STRING) 
{
                 struct.password = iprot.readString();
                 struct.setPasswordIsSet(true);
@@ -47676,9 +47776,14 @@ public class Airavata {
           oprot.writeString(struct.gatewayId);
           oprot.writeFieldEnd();
         }
-        if (struct.userName != null) {
-          oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
-          oprot.writeString(struct.userName);
+        if (struct.portalUserName != null) {
+          oprot.writeFieldBegin(PORTAL_USER_NAME_FIELD_DESC);
+          oprot.writeString(struct.portalUserName);
+          oprot.writeFieldEnd();
+        }
+        if (struct.loginUserName != null) {
+          oprot.writeFieldBegin(LOGIN_USER_NAME_FIELD_DESC);
+          oprot.writeString(struct.loginUserName);
           oprot.writeFieldEnd();
         }
         if (struct.password != null) {
@@ -47705,7 +47810,8 @@ public class Airavata {
         TTupleProtocol oprot = (TTupleProtocol) prot;
         struct.authzToken.write(oprot);
         oprot.writeString(struct.gatewayId);
-        oprot.writeString(struct.userName);
+        oprot.writeString(struct.portalUserName);
+        oprot.writeString(struct.loginUserName);
         oprot.writeString(struct.password);
       }
 
@@ -47717,8 +47823,10 @@ public class Airavata {
         struct.setAuthzTokenIsSet(true);
         struct.gatewayId = iprot.readString();
         struct.setGatewayIdIsSet(true);
-        struct.userName = iprot.readString();
-        struct.setUserNameIsSet(true);
+        struct.portalUserName = iprot.readString();
+        struct.setPortalUserNameIsSet(true);
+        struct.loginUserName = iprot.readString();
+        struct.setLoginUserNameIsSet(true);
         struct.password = iprot.readString();
         struct.setPasswordIsSet(true);
       }

http://git-wip-us.apache.org/repos/asf/airavata/blob/c7400a91/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp
----------------------------------------------------------------------
diff --git 
a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp
 
b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp
index 1b8f4c3..3ff3a36 100644
--- 
a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp
+++ 
b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp
@@ -4171,7 +4171,8 @@ uint32_t 
Airavata_registerPwdCredential_args::read(::apache::thrift::protocol::T
 
   bool isset_authzToken = false;
   bool isset_gatewayId = false;
-  bool isset_userName = false;
+  bool isset_portalUserName = false;
+  bool isset_loginUserName = false;
   bool isset_password = false;
 
   while (true)
@@ -4200,14 +4201,22 @@ uint32_t 
Airavata_registerPwdCredential_args::read(::apache::thrift::protocol::T
         break;
       case 3:
         if (ftype == ::apache::thrift::protocol::T_STRING) {
-          xfer += iprot->readString(this->userName);
-          isset_userName = true;
+          xfer += iprot->readString(this->portalUserName);
+          isset_portalUserName = true;
         } else {
           xfer += iprot->skip(ftype);
         }
         break;
       case 4:
         if (ftype == ::apache::thrift::protocol::T_STRING) {
+          xfer += iprot->readString(this->loginUserName);
+          isset_loginUserName = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      case 5:
+        if (ftype == ::apache::thrift::protocol::T_STRING) {
           xfer += iprot->readString(this->password);
           isset_password = true;
         } else {
@@ -4227,7 +4236,9 @@ uint32_t 
Airavata_registerPwdCredential_args::read(::apache::thrift::protocol::T
     throw TProtocolException(TProtocolException::INVALID_DATA);
   if (!isset_gatewayId)
     throw TProtocolException(TProtocolException::INVALID_DATA);
-  if (!isset_userName)
+  if (!isset_portalUserName)
+    throw TProtocolException(TProtocolException::INVALID_DATA);
+  if (!isset_loginUserName)
     throw TProtocolException(TProtocolException::INVALID_DATA);
   if (!isset_password)
     throw TProtocolException(TProtocolException::INVALID_DATA);
@@ -4247,11 +4258,15 @@ uint32_t 
Airavata_registerPwdCredential_args::write(::apache::thrift::protocol::
   xfer += oprot->writeString(this->gatewayId);
   xfer += oprot->writeFieldEnd();
 
-  xfer += oprot->writeFieldBegin("userName", 
::apache::thrift::protocol::T_STRING, 3);
-  xfer += oprot->writeString(this->userName);
+  xfer += oprot->writeFieldBegin("portalUserName", 
::apache::thrift::protocol::T_STRING, 3);
+  xfer += oprot->writeString(this->portalUserName);
   xfer += oprot->writeFieldEnd();
 
-  xfer += oprot->writeFieldBegin("password", 
::apache::thrift::protocol::T_STRING, 4);
+  xfer += oprot->writeFieldBegin("loginUserName", 
::apache::thrift::protocol::T_STRING, 4);
+  xfer += oprot->writeString(this->loginUserName);
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldBegin("password", 
::apache::thrift::protocol::T_STRING, 5);
   xfer += oprot->writeString(this->password);
   xfer += oprot->writeFieldEnd();
 
@@ -4278,11 +4293,15 @@ uint32_t 
Airavata_registerPwdCredential_pargs::write(::apache::thrift::protocol:
   xfer += oprot->writeString((*(this->gatewayId)));
   xfer += oprot->writeFieldEnd();
 
-  xfer += oprot->writeFieldBegin("userName", 
::apache::thrift::protocol::T_STRING, 3);
-  xfer += oprot->writeString((*(this->userName)));
+  xfer += oprot->writeFieldBegin("portalUserName", 
::apache::thrift::protocol::T_STRING, 3);
+  xfer += oprot->writeString((*(this->portalUserName)));
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldBegin("loginUserName", 
::apache::thrift::protocol::T_STRING, 4);
+  xfer += oprot->writeString((*(this->loginUserName)));
   xfer += oprot->writeFieldEnd();
 
-  xfer += oprot->writeFieldBegin("password", 
::apache::thrift::protocol::T_STRING, 4);
+  xfer += oprot->writeFieldBegin("password", 
::apache::thrift::protocol::T_STRING, 5);
   xfer += oprot->writeString((*(this->password)));
   xfer += oprot->writeFieldEnd();
 
@@ -46883,13 +46902,13 @@ void 
AiravataClient::recv_generateAndRegisterSSHKeys(std::string& _return)
   throw 
::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT,
 "generateAndRegisterSSHKeys failed: unknown result");
 }
 
-void AiravataClient::registerPwdCredential(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& userName, const std::string& password)
+void AiravataClient::registerPwdCredential(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& portalUserName, const std::string& loginUserName, 
const std::string& password)
 {
-  send_registerPwdCredential(authzToken, gatewayId, userName, password);
+  send_registerPwdCredential(authzToken, gatewayId, portalUserName, 
loginUserName, password);
   recv_registerPwdCredential(_return);
 }
 
-void AiravataClient::send_registerPwdCredential(const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& userName, const std::string& password)
+void AiravataClient::send_registerPwdCredential(const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& portalUserName, const std::string& loginUserName, 
const std::string& password)
 {
   int32_t cseqid = 0;
   oprot_->writeMessageBegin("registerPwdCredential", 
::apache::thrift::protocol::T_CALL, cseqid);
@@ -46897,7 +46916,8 @@ void AiravataClient::send_registerPwdCredential(const  
::apache::airavata::model
   Airavata_registerPwdCredential_pargs args;
   args.authzToken = &authzToken;
   args.gatewayId = &gatewayId;
-  args.userName = &userName;
+  args.portalUserName = &portalUserName;
+  args.loginUserName = &loginUserName;
   args.password = &password;
   args.write(oprot_);
 
@@ -57373,7 +57393,7 @@ void 
AiravataProcessor::process_registerPwdCredential(int32_t seqid, ::apache::t
 
   Airavata_registerPwdCredential_result result;
   try {
-    iface_->registerPwdCredential(result.success, args.authzToken, 
args.gatewayId, args.userName, args.password);
+    iface_->registerPwdCredential(result.success, args.authzToken, 
args.gatewayId, args.portalUserName, args.loginUserName, args.password);
     result.__isset.success = true;
   } catch ( ::apache::airavata::api::error::InvalidRequestException &ire) {
     result.ire = ire;
@@ -67543,13 +67563,13 @@ void 
AiravataConcurrentClient::recv_generateAndRegisterSSHKeys(std::string& _ret
   } // end while(true)
 }
 
-void AiravataConcurrentClient::registerPwdCredential(std::string& _return, 
const  ::apache::airavata::model::security::AuthzToken& authzToken, const 
std::string& gatewayId, const std::string& userName, const std::string& 
password)
+void AiravataConcurrentClient::registerPwdCredential(std::string& _return, 
const  ::apache::airavata::model::security::AuthzToken& authzToken, const 
std::string& gatewayId, const std::string& portalUserName, const std::string& 
loginUserName, const std::string& password)
 {
-  int32_t seqid = send_registerPwdCredential(authzToken, gatewayId, userName, 
password);
+  int32_t seqid = send_registerPwdCredential(authzToken, gatewayId, 
portalUserName, loginUserName, password);
   recv_registerPwdCredential(_return, seqid);
 }
 
-int32_t AiravataConcurrentClient::send_registerPwdCredential(const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& userName, const std::string& password)
+int32_t AiravataConcurrentClient::send_registerPwdCredential(const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& portalUserName, const std::string& loginUserName, 
const std::string& password)
 {
   int32_t cseqid = this->sync_.generateSeqId();
   ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_);
@@ -67558,7 +67578,8 @@ int32_t 
AiravataConcurrentClient::send_registerPwdCredential(const  ::apache::ai
   Airavata_registerPwdCredential_pargs args;
   args.authzToken = &authzToken;
   args.gatewayId = &gatewayId;
-  args.userName = &userName;
+  args.portalUserName = &portalUserName;
+  args.loginUserName = &loginUserName;
   args.password = &password;
   args.write(oprot_);
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/c7400a91/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h
----------------------------------------------------------------------
diff --git 
a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h
 
b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h
index 36fa6f4..33c1aed 100644
--- 
a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h
+++ 
b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h
@@ -199,10 +199,12 @@ class AiravataIf {
    * @param gatewayId
    *    The identifier for the requested Gateway.
    * 
-   * @param userName
+   * @param portalUserName
    *    The User for which the credential should be registered. For community 
accounts, this user is the name of the
    *    community user name. For computational resources, this user name need 
not be the same user name on resoruces.
    * 
+   * @param loginUserName
+   * 
    * @param password
    * 
    * @return airavataCredStoreToken
@@ -213,10 +215,11 @@ class AiravataIf {
    * 
    * @param authzToken
    * @param gatewayId
-   * @param userName
+   * @param portalUserName
+   * @param loginUserName
    * @param password
    */
-  virtual void registerPwdCredential(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& userName, const std::string& password) = 0;
+  virtual void registerPwdCredential(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& portalUserName, const std::string& loginUserName, 
const std::string& password) = 0;
 
   /**
    * Get a Public Key by Providing the Token
@@ -2737,7 +2740,7 @@ class AiravataNull : virtual public AiravataIf {
   void generateAndRegisterSSHKeys(std::string& /* _return */, const  
::apache::airavata::model::security::AuthzToken& /* authzToken */, const 
std::string& /* gatewayId */, const std::string& /* userName */) {
     return;
   }
-  void registerPwdCredential(std::string& /* _return */, const  
::apache::airavata::model::security::AuthzToken& /* authzToken */, const 
std::string& /* gatewayId */, const std::string& /* userName */, const 
std::string& /* password */) {
+  void registerPwdCredential(std::string& /* _return */, const  
::apache::airavata::model::security::AuthzToken& /* authzToken */, const 
std::string& /* gatewayId */, const std::string& /* portalUserName */, const 
std::string& /* loginUserName */, const std::string& /* password */) {
     return;
   }
   void getSSHPubKey(std::string& /* _return */, const  
::apache::airavata::model::security::AuthzToken& /* authzToken */, const 
std::string& /* airavataCredStoreToken */, const std::string& /* gatewayId */) {
@@ -5091,20 +5094,23 @@ class Airavata_registerPwdCredential_args {
 
   Airavata_registerPwdCredential_args(const 
Airavata_registerPwdCredential_args&);
   Airavata_registerPwdCredential_args& operator=(const 
Airavata_registerPwdCredential_args&);
-  Airavata_registerPwdCredential_args() : gatewayId(), userName(), password() {
+  Airavata_registerPwdCredential_args() : gatewayId(), portalUserName(), 
loginUserName(), password() {
   }
 
   virtual ~Airavata_registerPwdCredential_args() throw();
    ::apache::airavata::model::security::AuthzToken authzToken;
   std::string gatewayId;
-  std::string userName;
+  std::string portalUserName;
+  std::string loginUserName;
   std::string password;
 
   void __set_authzToken(const  
::apache::airavata::model::security::AuthzToken& val);
 
   void __set_gatewayId(const std::string& val);
 
-  void __set_userName(const std::string& val);
+  void __set_portalUserName(const std::string& val);
+
+  void __set_loginUserName(const std::string& val);
 
   void __set_password(const std::string& val);
 
@@ -5114,7 +5120,9 @@ class Airavata_registerPwdCredential_args {
       return false;
     if (!(gatewayId == rhs.gatewayId))
       return false;
-    if (!(userName == rhs.userName))
+    if (!(portalUserName == rhs.portalUserName))
+      return false;
+    if (!(loginUserName == rhs.loginUserName))
       return false;
     if (!(password == rhs.password))
       return false;
@@ -5139,7 +5147,8 @@ class Airavata_registerPwdCredential_pargs {
   virtual ~Airavata_registerPwdCredential_pargs() throw();
   const  ::apache::airavata::model::security::AuthzToken* authzToken;
   const std::string* gatewayId;
-  const std::string* userName;
+  const std::string* portalUserName;
+  const std::string* loginUserName;
   const std::string* password;
 
   uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
@@ -23924,8 +23933,8 @@ class AiravataClient : virtual public AiravataIf {
   void generateAndRegisterSSHKeys(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& userName);
   void send_generateAndRegisterSSHKeys(const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& userName);
   void recv_generateAndRegisterSSHKeys(std::string& _return);
-  void registerPwdCredential(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& userName, const std::string& password);
-  void send_registerPwdCredential(const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& userName, const std::string& password);
+  void registerPwdCredential(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& portalUserName, const std::string& loginUserName, 
const std::string& password);
+  void send_registerPwdCredential(const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& portalUserName, const std::string& loginUserName, 
const std::string& password);
   void recv_registerPwdCredential(std::string& _return);
   void getSSHPubKey(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
airavataCredStoreToken, const std::string& gatewayId);
   void send_getSSHPubKey(const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
airavataCredStoreToken, const std::string& gatewayId);
@@ -24797,13 +24806,13 @@ class AiravataMultiface : virtual public AiravataIf {
     return;
   }
 
-  void registerPwdCredential(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& userName, const std::string& password) {
+  void registerPwdCredential(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& portalUserName, const std::string& loginUserName, 
const std::string& password) {
     size_t sz = ifaces_.size();
     size_t i = 0;
     for (; i < (sz - 1); ++i) {
-      ifaces_[i]->registerPwdCredential(_return, authzToken, gatewayId, 
userName, password);
+      ifaces_[i]->registerPwdCredential(_return, authzToken, gatewayId, 
portalUserName, loginUserName, password);
     }
-    ifaces_[i]->registerPwdCredential(_return, authzToken, gatewayId, 
userName, password);
+    ifaces_[i]->registerPwdCredential(_return, authzToken, gatewayId, 
portalUserName, loginUserName, password);
     return;
   }
 
@@ -26150,8 +26159,8 @@ class AiravataConcurrentClient : virtual public 
AiravataIf {
   void generateAndRegisterSSHKeys(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& userName);
   int32_t send_generateAndRegisterSSHKeys(const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& userName);
   void recv_generateAndRegisterSSHKeys(std::string& _return, const int32_t 
seqid);
-  void registerPwdCredential(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& userName, const std::string& password);
-  int32_t send_registerPwdCredential(const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& userName, const std::string& password);
+  void registerPwdCredential(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& portalUserName, const std::string& loginUserName, 
const std::string& password);
+  int32_t send_registerPwdCredential(const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& portalUserName, const std::string& loginUserName, 
const std::string& password);
   void recv_registerPwdCredential(std::string& _return, const int32_t seqid);
   void getSSHPubKey(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
airavataCredStoreToken, const std::string& gatewayId);
   int32_t send_getSSHPubKey(const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
airavataCredStoreToken, const std::string& gatewayId);

http://git-wip-us.apache.org/repos/asf/airavata/blob/c7400a91/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp
----------------------------------------------------------------------
diff --git 
a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp
 
b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp
index 203310d..8583e1b 100644
--- 
a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp
+++ 
b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp
@@ -245,10 +245,12 @@ class AiravataHandler : virtual public AiravataIf {
    * @param gatewayId
    *    The identifier for the requested Gateway.
    * 
-   * @param userName
+   * @param portalUserName
    *    The User for which the credential should be registered. For community 
accounts, this user is the name of the
    *    community user name. For computational resources, this user name need 
not be the same user name on resoruces.
    * 
+   * @param loginUserName
+   * 
    * @param password
    * 
    * @return airavataCredStoreToken
@@ -259,10 +261,11 @@ class AiravataHandler : virtual public AiravataIf {
    * 
    * @param authzToken
    * @param gatewayId
-   * @param userName
+   * @param portalUserName
+   * @param loginUserName
    * @param password
    */
-  void registerPwdCredential(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& userName, const std::string& password) {
+  void registerPwdCredential(std::string& _return, const  
::apache::airavata::model::security::AuthzToken& authzToken, const std::string& 
gatewayId, const std::string& portalUserName, const std::string& loginUserName, 
const std::string& password) {
     // Your implementation goes here
     printf("registerPwdCredential\n");
   }

http://git-wip-us.apache.org/repos/asf/airavata/blob/c7400a91/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
----------------------------------------------------------------------
diff --git 
a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
 
b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
index 54f8228..9f570e8 100644
--- 
a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
+++ 
b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
@@ -253,10 +253,12 @@ interface AiravataIf {
    * @param gatewayId
    *    The identifier for the requested Gateway.
    * 
-   * @param userName
+   * @param portalUserName
    *    The User for which the credential should be registered. For community 
accounts, this user is the name of the
    *    community user name. For computational resources, this user name need 
not be the same user name on resoruces.
    * 
+   * @param loginUserName
+   * 
    * @param password
    * 
    * @return airavataCredStoreToken
@@ -267,14 +269,15 @@ interface AiravataIf {
    * 
    * @param \Airavata\Model\Security\AuthzToken $authzToken
    * @param string $gatewayId
-   * @param string $userName
+   * @param string $portalUserName
+   * @param string $loginUserName
    * @param string $password
    * @return string
    * @throws \Airavata\API\Error\InvalidRequestException
    * @throws \Airavata\API\Error\AiravataClientException
    * @throws \Airavata\API\Error\AiravataSystemException
    */
-  public function registerPwdCredential(\Airavata\Model\Security\AuthzToken 
$authzToken, $gatewayId, $userName, $password);
+  public function registerPwdCredential(\Airavata\Model\Security\AuthzToken 
$authzToken, $gatewayId, $portalUserName, $loginUserName, $password);
   /**
    * Get a Public Key by Providing the Token
    * 
@@ -4486,18 +4489,19 @@ class AiravataClient implements 
\Airavata\API\AiravataIf {
     throw new \Exception("generateAndRegisterSSHKeys failed: unknown result");
   }
 
-  public function registerPwdCredential(\Airavata\Model\Security\AuthzToken 
$authzToken, $gatewayId, $userName, $password)
+  public function registerPwdCredential(\Airavata\Model\Security\AuthzToken 
$authzToken, $gatewayId, $portalUserName, $loginUserName, $password)
   {
-    $this->send_registerPwdCredential($authzToken, $gatewayId, $userName, 
$password);
+    $this->send_registerPwdCredential($authzToken, $gatewayId, 
$portalUserName, $loginUserName, $password);
     return $this->recv_registerPwdCredential();
   }
 
-  public function 
send_registerPwdCredential(\Airavata\Model\Security\AuthzToken $authzToken, 
$gatewayId, $userName, $password)
+  public function 
send_registerPwdCredential(\Airavata\Model\Security\AuthzToken $authzToken, 
$gatewayId, $portalUserName, $loginUserName, $password)
   {
     $args = new \Airavata\API\Airavata_registerPwdCredential_args();
     $args->authzToken = $authzToken;
     $args->gatewayId = $gatewayId;
-    $args->userName = $userName;
+    $args->portalUserName = $portalUserName;
+    $args->loginUserName = $loginUserName;
     $args->password = $password;
     $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && 
function_exists('thrift_protocol_write_binary');
     if ($bin_accel)
@@ -17116,7 +17120,11 @@ class Airavata_registerPwdCredential_args {
   /**
    * @var string
    */
-  public $userName = null;
+  public $portalUserName = null;
+  /**
+   * @var string
+   */
+  public $loginUserName = null;
   /**
    * @var string
    */
@@ -17135,10 +17143,14 @@ class Airavata_registerPwdCredential_args {
           'type' => TType::STRING,
           ),
         3 => array(
-          'var' => 'userName',
+          'var' => 'portalUserName',
           'type' => TType::STRING,
           ),
         4 => array(
+          'var' => 'loginUserName',
+          'type' => TType::STRING,
+          ),
+        5 => array(
           'var' => 'password',
           'type' => TType::STRING,
           ),
@@ -17151,8 +17163,11 @@ class Airavata_registerPwdCredential_args {
       if (isset($vals['gatewayId'])) {
         $this->gatewayId = $vals['gatewayId'];
       }
-      if (isset($vals['userName'])) {
-        $this->userName = $vals['userName'];
+      if (isset($vals['portalUserName'])) {
+        $this->portalUserName = $vals['portalUserName'];
+      }
+      if (isset($vals['loginUserName'])) {
+        $this->loginUserName = $vals['loginUserName'];
       }
       if (isset($vals['password'])) {
         $this->password = $vals['password'];
@@ -17196,13 +17211,20 @@ class Airavata_registerPwdCredential_args {
           break;
         case 3:
           if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->userName);
+            $xfer += $input->readString($this->portalUserName);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
         case 4:
           if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->loginUserName);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 5:
+          if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->password);
           } else {
             $xfer += $input->skip($ftype);
@@ -17234,13 +17256,18 @@ class Airavata_registerPwdCredential_args {
       $xfer += $output->writeString($this->gatewayId);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->userName !== null) {
-      $xfer += $output->writeFieldBegin('userName', TType::STRING, 3);
-      $xfer += $output->writeString($this->userName);
+    if ($this->portalUserName !== null) {
+      $xfer += $output->writeFieldBegin('portalUserName', TType::STRING, 3);
+      $xfer += $output->writeString($this->portalUserName);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->loginUserName !== null) {
+      $xfer += $output->writeFieldBegin('loginUserName', TType::STRING, 4);
+      $xfer += $output->writeString($this->loginUserName);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->password !== null) {
-      $xfer += $output->writeFieldBegin('password', TType::STRING, 4);
+      $xfer += $output->writeFieldBegin('password', TType::STRING, 5);
       $xfer += $output->writeString($this->password);
       $xfer += $output->writeFieldEnd();
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/c7400a91/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata-remote
----------------------------------------------------------------------
diff --git 
a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata-remote
 
b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata-remote
index cd1bd6a..dc3d0ef 100755
--- 
a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata-remote
+++ 
b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata-remote
@@ -38,7 +38,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':
   print('  Notification getNotification(AuthzToken authzToken, string 
gatewayId, string notificationId)')
   print('   getAllNotifications(AuthzToken authzToken, string gatewayId)')
   print('  string generateAndRegisterSSHKeys(AuthzToken authzToken, string 
gatewayId, string userName)')
-  print('  string registerPwdCredential(AuthzToken authzToken, string 
gatewayId, string userName, string password)')
+  print('  string registerPwdCredential(AuthzToken authzToken, string 
gatewayId, string portalUserName, string loginUserName, string password)')
   print('  string getSSHPubKey(AuthzToken authzToken, string 
airavataCredStoreToken, string gatewayId)')
   print('   getAllUserSSHPubKeys(AuthzToken authzToken, string userName)')
   print('   getAllGatewaySSHPubKeys(AuthzToken authzToken, string gatewayId)')
@@ -312,10 +312,10 @@ elif cmd == 'generateAndRegisterSSHKeys':
   pp.pprint(client.generateAndRegisterSSHKeys(eval(args[0]),args[1],args[2],))
 
 elif cmd == 'registerPwdCredential':
-  if len(args) != 4:
-    print('registerPwdCredential requires 4 args')
+  if len(args) != 5:
+    print('registerPwdCredential requires 5 args')
     sys.exit(1)
-  
pp.pprint(client.registerPwdCredential(eval(args[0]),args[1],args[2],args[3],))
+  
pp.pprint(client.registerPwdCredential(eval(args[0]),args[1],args[2],args[3],args[4],))
 
 elif cmd == 'getSSHPubKey':
   if len(args) != 3:

http://git-wip-us.apache.org/repos/asf/airavata/blob/c7400a91/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata.py
----------------------------------------------------------------------
diff --git 
a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata.py
 
b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata.py
index 46f4a4b..73728fb 100644
--- 
a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata.py
+++ 
b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata.py
@@ -223,17 +223,19 @@ class Iface:
     """
     pass
 
-  def registerPwdCredential(self, authzToken, gatewayId, userName, password):
+  def registerPwdCredential(self, authzToken, gatewayId, portalUserName, 
loginUserName, password):
     """
     Generate and Register Username PWD Pair with Airavata Credential Store.
 
     @param gatewayId
        The identifier for the requested Gateway.
 
-    @param userName
+    @param portalUserName
        The User for which the credential should be registered. For community 
accounts, this user is the name of the
        community user name. For computational resources, this user name need 
not be the same user name on resoruces.
 
+    @param loginUserName
+
     @param password
 
     @return airavataCredStoreToken
@@ -245,7 +247,8 @@ class Iface:
     Parameters:
      - authzToken
      - gatewayId
-     - userName
+     - portalUserName
+     - loginUserName
      - password
     """
     pass
@@ -3722,17 +3725,19 @@ class Client(Iface):
       raise result.ase
     raise TApplicationException(TApplicationException.MISSING_RESULT, 
"generateAndRegisterSSHKeys failed: unknown result")
 
-  def registerPwdCredential(self, authzToken, gatewayId, userName, password):
+  def registerPwdCredential(self, authzToken, gatewayId, portalUserName, 
loginUserName, password):
     """
     Generate and Register Username PWD Pair with Airavata Credential Store.
 
     @param gatewayId
        The identifier for the requested Gateway.
 
-    @param userName
+    @param portalUserName
        The User for which the credential should be registered. For community 
accounts, this user is the name of the
        community user name. For computational resources, this user name need 
not be the same user name on resoruces.
 
+    @param loginUserName
+
     @param password
 
     @return airavataCredStoreToken
@@ -3744,18 +3749,20 @@ class Client(Iface):
     Parameters:
      - authzToken
      - gatewayId
-     - userName
+     - portalUserName
+     - loginUserName
      - password
     """
-    self.send_registerPwdCredential(authzToken, gatewayId, userName, password)
+    self.send_registerPwdCredential(authzToken, gatewayId, portalUserName, 
loginUserName, password)
     return self.recv_registerPwdCredential()
 
-  def send_registerPwdCredential(self, authzToken, gatewayId, userName, 
password):
+  def send_registerPwdCredential(self, authzToken, gatewayId, portalUserName, 
loginUserName, password):
     self._oprot.writeMessageBegin('registerPwdCredential', TMessageType.CALL, 
self._seqid)
     args = registerPwdCredential_args()
     args.authzToken = authzToken
     args.gatewayId = gatewayId
-    args.userName = userName
+    args.portalUserName = portalUserName
+    args.loginUserName = loginUserName
     args.password = password
     args.write(self._oprot)
     self._oprot.writeMessageEnd()
@@ -11648,7 +11655,7 @@ class Processor(Iface, TProcessor):
     iprot.readMessageEnd()
     result = registerPwdCredential_result()
     try:
-      result.success = self._handler.registerPwdCredential(args.authzToken, 
args.gatewayId, args.userName, args.password)
+      result.success = self._handler.registerPwdCredential(args.authzToken, 
args.gatewayId, args.portalUserName, args.loginUserName, args.password)
       msg_type = TMessageType.REPLY
     except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
       raise
@@ -18667,7 +18674,8 @@ class registerPwdCredential_args:
   Attributes:
    - authzToken
    - gatewayId
-   - userName
+   - portalUserName
+   - loginUserName
    - password
   """
 
@@ -18675,14 +18683,16 @@ class registerPwdCredential_args:
     None, # 0
     (1, TType.STRUCT, 'authzToken', 
(apache.airavata.model.security.ttypes.AuthzToken, 
apache.airavata.model.security.ttypes.AuthzToken.thrift_spec), None, ), # 1
     (2, TType.STRING, 'gatewayId', None, None, ), # 2
-    (3, TType.STRING, 'userName', None, None, ), # 3
-    (4, TType.STRING, 'password', None, None, ), # 4
+    (3, TType.STRING, 'portalUserName', None, None, ), # 3
+    (4, TType.STRING, 'loginUserName', None, None, ), # 4
+    (5, TType.STRING, 'password', None, None, ), # 5
   )
 
-  def __init__(self, authzToken=None, gatewayId=None, userName=None, 
password=None,):
+  def __init__(self, authzToken=None, gatewayId=None, portalUserName=None, 
loginUserName=None, password=None,):
     self.authzToken = authzToken
     self.gatewayId = gatewayId
-    self.userName = userName
+    self.portalUserName = portalUserName
+    self.loginUserName = loginUserName
     self.password = password
 
   def read(self, iprot):
@@ -18707,11 +18717,16 @@ class registerPwdCredential_args:
           iprot.skip(ftype)
       elif fid == 3:
         if ftype == TType.STRING:
-          self.userName = iprot.readString()
+          self.portalUserName = iprot.readString()
         else:
           iprot.skip(ftype)
       elif fid == 4:
         if ftype == TType.STRING:
+          self.loginUserName = iprot.readString()
+        else:
+          iprot.skip(ftype)
+      elif fid == 5:
+        if ftype == TType.STRING:
           self.password = iprot.readString()
         else:
           iprot.skip(ftype)
@@ -18733,12 +18748,16 @@ class registerPwdCredential_args:
       oprot.writeFieldBegin('gatewayId', TType.STRING, 2)
       oprot.writeString(self.gatewayId)
       oprot.writeFieldEnd()
-    if self.userName is not None:
-      oprot.writeFieldBegin('userName', TType.STRING, 3)
-      oprot.writeString(self.userName)
+    if self.portalUserName is not None:
+      oprot.writeFieldBegin('portalUserName', TType.STRING, 3)
+      oprot.writeString(self.portalUserName)
+      oprot.writeFieldEnd()
+    if self.loginUserName is not None:
+      oprot.writeFieldBegin('loginUserName', TType.STRING, 4)
+      oprot.writeString(self.loginUserName)
       oprot.writeFieldEnd()
     if self.password is not None:
-      oprot.writeFieldBegin('password', TType.STRING, 4)
+      oprot.writeFieldBegin('password', TType.STRING, 5)
       oprot.writeString(self.password)
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -18749,8 +18768,10 @@ class registerPwdCredential_args:
       raise TProtocol.TProtocolException(message='Required field authzToken is 
unset!')
     if self.gatewayId is None:
       raise TProtocol.TProtocolException(message='Required field gatewayId is 
unset!')
-    if self.userName is None:
-      raise TProtocol.TProtocolException(message='Required field userName is 
unset!')
+    if self.portalUserName is None:
+      raise TProtocol.TProtocolException(message='Required field 
portalUserName is unset!')
+    if self.loginUserName is None:
+      raise TProtocol.TProtocolException(message='Required field loginUserName 
is unset!')
     if self.password is None:
       raise TProtocol.TProtocolException(message='Required field password is 
unset!')
     return
@@ -18760,7 +18781,8 @@ class registerPwdCredential_args:
     value = 17
     value = (value * 31) ^ hash(self.authzToken)
     value = (value * 31) ^ hash(self.gatewayId)
-    value = (value * 31) ^ hash(self.userName)
+    value = (value * 31) ^ hash(self.portalUserName)
+    value = (value * 31) ^ hash(self.loginUserName)
     value = (value * 31) ^ hash(self.password)
     return value
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/c7400a91/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
----------------------------------------------------------------------
diff --git 
a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
 
b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
index 9f3a209..7a9c908 100644
--- 
a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
+++ 
b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
@@ -137,7 +137,8 @@ public class CredentialStoreServerHandler implements 
CredentialStoreService.Ifac
         try {
             
org.apache.airavata.credential.store.credential.impl.password.PasswordCredential
 credential = new 
org.apache.airavata.credential.store.credential.impl.password.PasswordCredential();
             credential.setGateway(passwordCredential.getGatewayId());
-            credential.setUserName(passwordCredential.getUsername());
+            
credential.setPortalUserName(passwordCredential.getPortalUserName());
+            credential.setUserName(passwordCredential.getLoginUserName());
             credential.setPassword(passwordCredential.getPassword());
             credential.setDescription(passwordCredential.getDescription());
             String token = 
TokenGenerator.generateToken(passwordCredential.getGatewayId(), null);
@@ -221,7 +222,8 @@ public class CredentialStoreServerHandler implements 
CredentialStoreService.Ifac
                         .store.credential.impl.password.PasswordCredential) 
credential;
                 PasswordCredential pwdCredential = new PasswordCredential();
                 pwdCredential.setGatewayId(credential1.getGateway());
-                pwdCredential.setUsername(credential1.getUserName());
+                
pwdCredential.setPortalUserName(credential1.getPortalUserName());
+                pwdCredential.setLoginUserName(credential1.getUserName());
                 pwdCredential.setPassword(credential1.getPassword());
                 pwdCredential.setDescription(credential1.getDescription());
                 pwdCredential.setToken(credential1.getToken());

Reply via email to