The interrupt JSON file contains a mapping of username to interrupt
configuration. The REST response is the only the configuration block for
the matched user. Drop the 'testuser' key and just return that block:

  {
    "autoRedirect": false,
    "autoRedirectAfterSeconds": -1,
    "block": false,
    "interrupt": true,
    "links": {
        "Google Link": "https://www.google.com";,
        "Yahoo Link": "https://www.yahoo.com";
    },
    "message": "This is the announcement message that will tell people what
to do",
    "ssoEnabled": false
  }

The 200 Ok response tells CAS to interrupt, but then it can't find the data
elements it expects.

-dirk
On Mon, Oct 29, 2018 at 4:43 PM Shawn Cutting <[email protected]> wrote:

> Greetings.
>
> I am looking for some sort of documentation or other source of help for
> how to properly use the Authorization Interrupt with a REST page response.
> I am able to see the CAS server calling my REST application, and I am able
> to appropriately process the call on the application, and the result is a
> straight JSON file in the exact same syntax as the interrupt.json file.
>
> If I use the same information that I am returning from my REST app in the
> json file, everything works like I would expect.  But the returned JSON
> does NOT follow the rules that are set in the json code.  It does recognize
> the specific user and only processes that user, but the rest of the rules
> are not followed.
>
> Here is what I am returning (with example 'testuser'):
>
> <?php
>
> if ($_GET["username"] == "testuser"){
>     header("HTTP/1.1 200 OK");
>     header('Content-Type:application/json');
>
>     $array = array("testuser" => array(
>         "message" => "This is the announcement message that will tell
> people what to do",
>         "links" => array(
>             "Yahoo Link" => urlencode("https://www.yahoo.com";),
>             "Google Link"  => urlencode("https://www.google.com";)
>         ),
>         "block" => false,
>         "ssoEnabled" => false,
>         "interrupt" => true,
>         "autoRedirect" => false,
>         "autoRedirectAfterSeconds" => -1
>     ));
>
>     echo urldecode(json_encode($array));
> }
> ?>
>
> If I put this json layout into the interrupt.json file, it works as it
> should (the message appears, the links appear, etc).  But when I call this
> php file, it sees that testuser is the user in play and it does interrupt
> the login, but the content is the default interrupt information with no
> custom message, no links.
>
>
> Has anyone had any success with the interrupt settings and REST?  Any help
> would be fabulous!
>
> Shawn
>
> --
> - Website: https://apereo.github.io/cas
> - Gitter Chatroom: https://gitter.im/apereo/cas
> - List Guidelines: https://goo.gl/1VRrw7
> - Contributions: https://goo.gl/mh7qDG
> ---
> You received this message because you are subscribed to the Google Groups
> "CAS Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/a/apereo.org/d/msgid/cas-user/7329613a-c5f1-4a15-b9fd-340dfad68331%40apereo.org
> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/7329613a-c5f1-4a15-b9fd-340dfad68331%40apereo.org?utm_medium=email&utm_source=footer>
> .
>

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAJ%3D0EZy1gyCZj9KiKyDLG%2BaoK5n%3DSxds2TSN%3DdnY8NbdqgnR%3DQ%40mail.gmail.com.

Reply via email to