summaryrefslogtreecommitdiff
path: root/indra/newview/llsecapi.cpp
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2010-04-22 15:09:34 -0700
committerRoxie Linden <roxie@lindenlab.com>2010-04-22 15:09:34 -0700
commit5e727964dbd6d5e55dd3a0921e8e1f0f77a99747 (patch)
tree4ff88aee455c4736de6b2f3e11d2828d8e1eecfe /indra/newview/llsecapi.cpp
parent5b9da4e8d91acd075dfaf33fb489c480c25e9ade (diff)
DEV-49332 - cryptic error message when typing in single username when logging into maingrid.
Needs to be changed when IE is checked in, of course. Now we check the expected credential formats for a given grid against the format that is typed in, and throw an error if it's invalid.
Diffstat (limited to 'indra/newview/llsecapi.cpp')
-rw-r--r--indra/newview/llsecapi.cpp52
1 files changed, 42 insertions, 10 deletions
diff --git a/indra/newview/llsecapi.cpp b/indra/newview/llsecapi.cpp
index ba343f5387..b3e96298d2 100644
--- a/indra/newview/llsecapi.cpp
+++ b/indra/newview/llsecapi.cpp
@@ -143,19 +143,51 @@ int secapiSSLCertVerifyCallback(X509_STORE_CTX *ctx, void *param)
LLSD LLCredential::getLoginParams()
{
LLSD result = LLSD::emptyMap();
- if (mIdentifier["type"].asString() == "agent")
+ try
{
- // legacy credential
- result["passwd"] = "$1$" + mAuthenticator["secret"].asString();
- result["first"] = mIdentifier["first_name"];
- result["last"] = mIdentifier["last_name"];
-
+ if (mIdentifier["type"].asString() == "agent")
+ {
+ // legacy credential
+ result["passwd"] = "$1$" + mAuthenticator["secret"].asString();
+ result["first"] = mIdentifier["first_name"];
+ result["last"] = mIdentifier["last_name"];
+
+ }
+ else if (mIdentifier["type"].asString() == "account")
+ {
+ result["username"] = mIdentifier["account_name"];
+ result["passwd"] = mAuthenticator["secret"];
+
+ }
}
- else if (mIdentifier["type"].asString() == "account")
+ catch (...)
{
- result["username"] = mIdentifier["account_name"];
- result["passwd"] = mAuthenticator["secret"];
-
+ // we could have corrupt data, so simply return a null login param if so
+ LL_WARNS("AppInit") << "Invalid credential" << LL_ENDL;
}
return result;
}
+
+void LLCredential::identifierType(std::string &idType)
+{
+ if(mIdentifier.has("type"))
+ {
+ idType = mIdentifier["type"].asString();
+ }
+ else {
+ idType = std::string();
+
+ }
+}
+
+void LLCredential::authenticatorType(std::string &idType)
+{
+ if(mAuthenticator.has("type"))
+ {
+ idType = mAuthenticator["type"].asString();
+ }
+ else {
+ idType = std::string();
+
+ }
+} \ No newline at end of file