<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><font face="monospace">On 22.5.2023 9.37, Greg Haverkamp via
        radiator wrote:<br>
      </font></p>
    <blockquote type="cite"
cite="mid:CAHEFaoSy592Ty3E_vU_oOfit41Fxitajcvz8RphQGx6EYswuow@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div class="gmail_default" style="font-size:large"><font
            face="monospace">I'm attempting to call a fairly simple (but
            non-modifiable) restful API by means of AuthBy REST, and I
            cannot seem to make sense of how I should act upon the
            response it gives.</font></div>
        <div class="gmail_default" style="font-size:large"><font
            face="monospace"><br>
            I get a JSON response that looks something like this:<br>
            {<br>
            "version": "LinOTP 2.11.2",<br>
            "jsonrpc": "2.0802",<br>
            "result": {<br>
               "status": true,<br>
               "value": false<br>
            },<br>
            "id": 0<br>
            }<br>
          </font></div>
        <div class="gmail_default" style="font-size:large"><font
            face="monospace"><br>
          </font></div>
      </div>
    </blockquote>
    <p><font face="monospace"><br>
      </font></p>
    <p><font face="monospace">I can create an example of how to access
        the contents of the "result" key. The default is to create a
        Perl hash for the keys but more complex structures require more
        configuration.<br>
      </font></p>
    <p><font face="monospace"><br>
      </font></p>
    <blockquote type="cite"
cite="mid:CAHEFaoSy592Ty3E_vU_oOfit41Fxitajcvz8RphQGx6EYswuow@mail.gmail.com">
      <div dir="ltr">
        <div class="gmail_default" style="font-size:large"><font
            face="monospace">I've also been trying MapResponseHook, but
            the documentation on that is, shall we say, spartan. I just
            figured it might get the server response into a place where
            I could access it via AuthBy internal or a post auth hook,
            maybe that's what's required.<br>
            <br>
            Does someone have an example of how to use this with JSON
            going back in response?</font></div>
      </div>
    </blockquote>
    <br>
    <p><font face="monospace">The MapResponseHook would be the tool
        here, and as you kindly put it, it needs a better example of how
        to process responses like the one above. I think there are at
        least two options here: use "status" and/or "value" directly to
        trigger a reject or reply, or then save their values so that
        they can be processed later. For example, for a hook or another
        AuthBy you've mentioned above.</font></p>
    <p><font face="monospace"><br>
      </font></p>
    <p><font face="monospace">I'll get back to this.</font></p>
    <p><font face="monospace">Heikki<br>
      </font></p>
    <p><font face="monospace"><br>
      </font></p>
  </body>
</html>