Login Redirect

Syntax

{
    "Key": "redirect:on:login",
    "Value": {
        "Type": "page_redirect|url_redirect|trigger_callback|default",
        "PageSlug": "string",
        "PageId": "numeric",
        "Url": "string",
        "Callback": "string"
    }
}

The properties PageSlug, PageId, Url, and Callback are required depending on the selected Type. For instance, if page_redirect type is chosen, then the PageSlug or PageId property must also be provided.

Examples

The following policy redirects user to the /monday-agenda if current day is Monday.

{
    "Param": {
        "Key": "redirect:on:login",
        "Value": {
            "Type": "url_redirect",
            "Url": "/monday-agenda"
        },
        "Condition": {
            "Equals": {
                "${DATETIME.D}": "Mon"
            }
        }
    }
}

Definition

The login redirect behavior is expressed in the AAM access policy as the param redirect:on:login. The Value property contains attributes that define how to handle redirects.

The Type attribute defines what type of redirect to apply and can contain one of the following values:

Depending on the Type additional information may be required to fine-tune the redirect as follows:

Here is another example where we redirect a user who has the “Subscriber” role to the /members/ page.

{
    "Param": [
        {
            "Key": "redirect:on:login",
            "Value": {
                "Type": "url_redirect",
                "Url": "https://demo.aamportal.com/members"
            },
            "Condition": {
                "In": {
                    "subscriber": "(*array)${USER.roles}"
                }
            }
        }
    ]
}