Skip to content
Snippets Groups Projects
Commit 30cd108c authored by Brad Kittenbrink's avatar Brad Kittenbrink
Browse files

SL-16388 Viewer MFA Implementation Improvements

token input is now handled and message formatting is improved.
Added beginnings of support for saving slmfa_hash value client side.
parent d307843d
No related branches found
No related tags found
No related merge requests found
...@@ -46,35 +46,36 @@ LLFloaterMFA::~LLFloaterMFA() ...@@ -46,35 +46,36 @@ LLFloaterMFA::~LLFloaterMFA()
BOOL LLFloaterMFA::postBuild() BOOL LLFloaterMFA::postBuild()
{ {
childSetAction("Continue", onContinue, this); centerOnScreen();
childSetAction("Cancel", onCancel, this);
if (hasChild("token_prompt")) childSetAction("continue_btn", onContinue, this);
childSetAction("cancel_btn", onCancel, this);
childSetCommitCallback("token_edit", [](LLUICtrl*, void* userdata) { onContinue(userdata);}, this);
if (hasChild("token_prompt_text"))
{ {
// this displays the prompt message // this displays the prompt message
LLUICtrl *token_prompt = getChild<LLUICtrl>("token_prompt"); LLUICtrl *token_prompt = getChild<LLUICtrl>("token_prompt_text");
token_prompt->setEnabled( FALSE ); token_prompt->setEnabled( FALSE );
token_prompt->setFocus(TRUE); token_prompt->setFocus(TRUE);
token_prompt->setValue(LLSD(mMessage)); token_prompt->setValue(LLSD(mMessage));
return TRUE;
} }
return TRUE; return TRUE;
} }
// static // static
void LLFloaterMFA::onContinue( void* userdata ) void LLFloaterMFA::onContinue(void* userdata )
{ {
LLFloaterMFA* self = (LLFloaterMFA*) userdata; LLFloaterMFA* self = static_cast<LLFloaterMFA*>(userdata);
LL_INFOS("MFA") << "User submits MFA token for challenge." << LL_ENDL; LL_INFOS("MFA") << "User submits MFA token for challenge." << LL_ENDL;
std::string token{"8675309"}; std::string token;
if (self->hasChild("token")) if (self->hasChild("token_edit"))
{ {
// this displays the prompt message // this displays the prompt message
LLUICtrl *token_ctrl = self->getChild<LLUICtrl>("token"); LLUICtrl *token_ctrl = self->getChild<LLUICtrl>("token_edit");
token = token_ctrl->getValue().asStringRef(); token = token_ctrl->getValue().asStringRef();
} }
...@@ -88,9 +89,9 @@ void LLFloaterMFA::onContinue( void* userdata ) ...@@ -88,9 +89,9 @@ void LLFloaterMFA::onContinue( void* userdata )
} }
// static // static
void LLFloaterMFA::onCancel( void* userdata ) void LLFloaterMFA::onCancel(void* userdata)
{ {
LLFloaterMFA* self = (LLFloaterMFA*) userdata; LLFloaterMFA* self = static_cast<LLFloaterMFA*>(userdata);
LL_INFOS("MFA") << "User cancels MFA challenge attempt." << LL_ENDL; LL_INFOS("MFA") << "User cancels MFA challenge attempt." << LL_ENDL;
if(self->mReplyPumpName != "") if(self->mReplyPumpName != "")
......
...@@ -228,6 +228,7 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia ...@@ -228,6 +228,7 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia
request_params["host_id"] = gSavedSettings.getString("HostID"); request_params["host_id"] = gSavedSettings.getString("HostID");
request_params["extended_errors"] = true; // request message_id and message_args request_params["extended_errors"] = true; // request message_id and message_args
request_params["token"] = ""; request_params["token"] = "";
request_params["slmfa_hash"] = "";
// log request_params _before_ adding the credentials // log request_params _before_ adding the credentials
LL_DEBUGS("LLLogin") << "Login parameters: " << LLSDOStreamer<LLSDNotationFormatter>(request_params) << LL_ENDL; LL_DEBUGS("LLLogin") << "Login parameters: " << LLSDOStreamer<LLSDNotationFormatter>(request_params) << LL_ENDL;
......
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater <floater
title="MFA Token Requred"
legacy_header_height="18" legacy_header_height="18"
can_minimize="false" can_minimize="false"
height="87" can_close="false"
height="110"
layout="topleft" layout="topleft"
name="mfa_challenge" name="mfa_challenge"
help_topic="mfa_challenge" help_topic="mfa_challenge"
width="480"> width="480">
<text <text
type="string" type="string"
word_wrap="true"
length="1" length="1"
bottom="20"
follows="top|left" follows="top|left"
height="15" height="15"
layout="topleft" layout="topleft"
left="10" left="10"
name="token_prompt" name="token_prompt_text"
top="20"> top="20">
token prompt token prompt
</text> </text>
<text_box <line_editor
allow_text_entry="true" allow_text_entry="true"
follows="left|top|right" follows="left|top|right"
height="19" height="19"
layout="topleft" layout="topleft"
left_delta="70" bottom_delta="40"
max_chars="16" max_chars="16"
name="token_entry" name="token_edit"
top_delta="-4" width="100" />
width="16" />
<button <button
follows="top|left" follows="top|left"
height="20" height="20"
label="Continue" label="Continue"
layout="topleft" layout="topleft"
left="10" left="10"
name="Continue" name="continue_btn"
top="50" bottom_delta="30"
width="64" /> width="64" />
<button <button
follows="top|left" follows="top|left"
...@@ -44,7 +45,7 @@ ...@@ -44,7 +45,7 @@
label="Cancel" label="Cancel"
layout="topleft" layout="topleft"
left_pad="5" left_pad="5"
name="Cancel" name="cancel_btn"
top_delta="0" bottom_delta="0"
width="64" /> width="64" />
</floater> </floater>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment