[prev in list] [next in list] [prev in thread] [next in thread] 

List:       forgerock-openam
Subject:    [OpenAM] Scripted Auth Module need 2 step RESTful API call
From:       Long Man <longman () barramandi ! com>
Date:       2017-11-16 8:37:46
Message-ID: CA+bvQzY+csqnVrq1t62-eya8OV_wQah5iz6fVXfbdZOYm+NRtg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


(Version 13.0.0)
Even though the Scripted Module already have "Client-side Script Enabled"
unchecked, it still requires the REST API call to do a 2 step call.
The first step will return below JSON message and this message need to be
POSTed back in the 2nd call to complete the authentication.

Is this a defect?
Since no client side script is needed, why it requires a second step
callback?


{
   "authId":
"eyAidHlwIjogIkpXVCIsICJhbGciOiAiSFMyNTYiIH0.eyAiYXV0aEluZGV4VmFsdWUiOiAidGVzdGNoYWluI \
iwgIm90ayI6ICIxN3Z1cDNzcmhvNjB0ZWpkYjVvNmp1ZGZoYSIsICJhdXRoSW5kZXhUeXBlIjogInNlcnZpY2U \
iLCAicmVhbG0iOiAiZGM9b3BlbmFtLGRjPWZvcmdlcm9jayxkYz1vcmciLCAic2Vzc2lvbklkIjogIkFRSUM1d \
00yTFk0U2Zjd1I3WFluREpHUEpkMFZueXJ3U3N3bG5VWFRReGlPNmF3LipBQUpUU1FBQ01ESUFBbE5MQUJRdE1 \
qWTJNRE01T1RVd01ERXlOVFl3TlRjMU5RQUNVekVBQUEuLioiIH0.Ak7lrE0Gv5nDthvXt21DQOZ1pp1PurbVkyrgl1Qmero",
  "template": "",
   "stage": "Scripted2",
   "header": "Sign in to OpenAM",
   "callbacks":    [
            {
         "type": "HiddenValueCallback",
         "output": [         {
            "name": "value",
            "value": ""
         }],
         "input": [         {
            "name": "IDToken1",
            "value": "clientScriptOutputData"
         }]
      },
            {
         "type": "TextOutputCallback",
         "output":          [
                        {
               "name": "message",
               "value": "if (window.require) {\n    var messenger =
require(\"org/forgerock/commons/ui/common/components/Messages\"),\n
spinner =
require(\"org/forgerock/commons/ui/common/main/SpinnerManager\"),\n
message =  {message:\"Collecting Data...\", type:\"info\"};\n
spinner.showSpinner();\n}(function(output) {\n    var autoSubmitDelay =
0,\n        submitted = false;\n    function submit() {\n        if
(submitted) {\n            return;\n        }        if (!(window.jQuery))
{\n            document.forms[0].submit();\n        } else {\n
$('input[type=submit]').trigger('click');\n        }\n        submitted =
true;\n    }\n    \n    setTimeout(submit, autoSubmitDelay);\n})
(document.forms[0].elements['clientScriptOutputData']);\n"
            },
                        {
               "name": "messageType",
               "value": "4"
            }
         ]
      }
   ]
}


[Attachment #5 (text/html)]

<div dir="ltr"><div>(Version 13.0.0)</div>Even though the Scripted Module already \
have &quot;<span style="color:rgb(42,47,50);font-family:&quot;Helvetica \
Neue&quot;,Helvetica,Arial,sans-serif;font-size:14px;font-weight:700;text-align:right">Client-side \
Script Enabled</span>&quot; unchecked, it still requires the REST API call to do a 2 \
step call.<div>The first step will return below JSON message and this message need to \
be POSTed back in the 2nd call to complete the \
authentication.</div><div><br></div><div>Is this a defect?</div><div>Since no client \
side script is needed, why it requires a second step \
callback?<br><div><br></div><div><br></div><div><div>{</div><div>     \
&quot;authId&quot;: &quot;eyAidHlwIjogIkpXVCIsICJhbGciOiAiSFMyNTYiIH0.eyAiYXV0aEluZGV4 \
VmFsdWUiOiAidGVzdGNoYWluIiwgIm90ayI6ICIxN3Z1cDNzcmhvNjB0ZWpkYjVvNmp1ZGZoYSIsICJhdXRoSW \
5kZXhUeXBlIjogInNlcnZpY2UiLCAicmVhbG0iOiAiZGM9b3BlbmFtLGRjPWZvcmdlcm9jayxkYz1vcmciLCAi \
c2Vzc2lvbklkIjogIkFRSUM1d00yTFk0U2Zjd1I3WFluREpHUEpkMFZueXJ3U3N3bG5VWFRReGlPNmF3LipBQU \
pUU1FBQ01ESUFBbE5MQUJRdE1qWTJNRE01T1RVd01ERXlOVFl3TlRjMU5RQUNVekVBQUEuLioiIH0.Ak7lrE0Gv5nDthvXt21DQOZ1pp1PurbVkyrgl1Qmero&quot;,</div><div> \
&quot;template&quot;: &quot;&quot;,</div><div>     &quot;stage&quot;: \
&quot;Scripted2&quot;,</div><div>     &quot;header&quot;: &quot;Sign in to \
OpenAM&quot;,</div><div>     &quot;callbacks&quot;:      [</div><div>                 \
{</div><div>              &quot;type&quot;: \
&quot;HiddenValueCallback&quot;,</div><div>              &quot;output&quot;: [        \
{</div><div>                  &quot;name&quot;: &quot;value&quot;,</div><div>         \
&quot;value&quot;: &quot;&quot;</div><div>              }],</div><div>              \
&quot;input&quot;: [              {</div><div>                  &quot;name&quot;: \
&quot;IDToken1&quot;,</div><div>                  &quot;value&quot;: \
&quot;clientScriptOutputData&quot;</div><div>              }]</div><div>         \
},</div><div>                  {</div><div>              &quot;type&quot;: \
&quot;TextOutputCallback&quot;,</div><div>              &quot;output&quot;:           \
[</div><div>                                    {</div><div>                       \
&quot;name&quot;: &quot;message&quot;,</div><div>                       \
&quot;value&quot;: &quot;if (window.require) {\n      var messenger = \
require(\&quot;org/forgerock/commons/ui/common/components/Messages\&quot;),\n         \
spinner =   require(\&quot;org/forgerock/commons/ui/common/main/SpinnerManager\&quot;),\n \
message =   {message:\&quot;Collecting Data...\&quot;, type:\&quot;info\&quot;};\n    \
spinner.showSpinner();\n}(function(output) {\n      var autoSubmitDelay = 0,\n        \
submitted = false;\n      function submit() {\n            if (submitted) {\n         \
return;\n            }            if (!(window.jQuery)) {\n                  \
document.forms[0].submit();\n            } else {\n                  \
$(&#39;input[type=submit]&#39;).trigger(&#39;click&#39;);\n            }\n            \
submitted = true;\n      }\n      \n      setTimeout(submit, autoSubmitDelay);\n}) \
(document.forms[0].elements[&#39;clientScriptOutputData&#39;]);\n&quot;</div><div>    \
},</div><div>                                    {</div><div>                       \
&quot;name&quot;: &quot;messageType&quot;,</div><div>                       \
&quot;value&quot;: &quot;4&quot;</div><div>                  }</div><div>             \
]</div><div>         }</div><div>     ]</div><div>}</div></div></div></div>



_______________________________________________
Visit the OpenAM forum at https://forgerock.org/forum/fr-projects/openam/
OpenAM mailing list
OpenAM@forgerock.org
https://lists.forgerock.org/mailman/listinfo/openam


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic