Deny access to application and redirect to customized error page

This document describes how to deny access to a resource, and redirect the user to a customized error page.

Background

The authenticator AuthController is used to deny access to a resource.

The authenticator typically uses the FlowFail valve to deny access. The valve uses conditions to calculate if the flow should be failed or not.

Pre reqs

  • The configurator is expected to have good knowledge in the way Fortified ID configuration works

Configure AuthController to deny access

  1. Add the AuthController authenticator to you configuration.

  2. Configure the failed_redirect array to match you fail-message and where to redirect.

  3. Set the use_generic_error_page to true.

  4. Go to the pipe and configure the FlowFail valve which should appear by default.

  5. The message will be displayed in the log-file and also used for triggering the specific redirect. Adjust the value to suite your use case.

  6. Adjust the exec_if_expr parameter to suite YOUR use case.

Examples AuthController

{
  "id": "authcontroller_1",
  "type": "AuthController",
  "description": "The AuthController authenticator is responsible for various levels of controls.",
  "config": {
    "base_path": "${globals.default_login_suffix}",
    "pipe_id": "authcontroller_1_pipe",
    "use_generic_error_page": true,
    "_fail_location": "https://fortifiedid.se",
    "failed_redirect": [
      {
        "pattern": ".*Step-up was performed by other person.*",
        "target": "${globals.default_login_suffix}/access/noaccess"
      },
      {
        "pattern": ".*Access denied to Application.*",
        "target": "${globals.default_login_location}/access/noaccess"
      }
    ]
  },
  "display_name": "Check access denied"
}

Examples Flow fail

If the SP has a specific entityID and the user NOT is member of a certain group

If the value of two properties are not equal

Configure the redirect endpoint

An information endpoint is used to for this.

  1. Add an information endpoint according to the example below OR extend your current information endpoint with the endpoint from the example

Configure translation

The information endpoint configuration is using translations for what message to show to the end user. This is done by using the key value from the context_path.header and context_path.paragraph.

An example of translations matching the configuration above would be

Customizing UI

To make the page look more pretty the header logo might need to be disabled. Please update the ui_config_overrides.json with the following configuration in order to do so.

Last updated