Sys-front-inj-logout Role

Description: Nginx sub_filter JavaScript injection redirecting all logout actions to a centralized OIDC single sign-out endpoint

Variables

  • author: Kevin Veen-Birkenbach

  • role_name: sys-front-inj-logout

  • description: Nginx sub_filter JavaScript injection redirecting all logout actions to a centralized OIDC single sign-out endpoint

  • license: Infinito.Nexus Community License (Non-Commercial)

  • min_ansible_version: 2.9

  • platforms: [{‘name’: ‘ArchLinux’, ‘versions’: [‘all’]}, {‘name’: ‘Debian’, ‘versions’: [‘all’]}, {‘name’: ‘EL’, ‘versions’: [‘all’]}, {‘name’: ‘Fedora’, ‘versions’: [‘all’]}, {‘name’: ‘Ubuntu’, ‘versions’: [‘all’]}]

  • galaxy_tags: [‘nginx’, ‘logout’, ‘oidc’, ‘javascript’, ‘csp’, ‘sub_filter’]

  • company: Kevin Veen-Birkenbach https://www.veen.world

  • issue_tracker_url: https://s.infinito.nexus/issues

README

sys-front-inj-logout

This role injects a catcher that intercepts all logout elements in HTML pages served by NGINX and redirects them to a centralized logout endpoint via JavaScript.

Description

The sys-front-inj-logout Ansible role automatically embeds a lightweight JavaScript snippet into your web application’s HTML responses. This script identifies logout links, buttons, forms, and other elements, overrides their target URLs, and ensures users are redirected to a central OIDC logout endpoint, providing a consistent single sign‑out experience.

Overview

  • Detection: Scans the DOM for anchors (<a>), buttons, inputs, forms, use elements and any attributes indicating logout functionality.

  • Override: Rewrites logout URLs to point at your OIDC provider’s logout endpoint.

  • Dynamic content support: Uses a MutationObserver to handle AJAX‑loaded or dynamically injected logout elements.

  • CSP integration: Automatically appends the required script hash into your CSP policy via the role’s CSP helper.

Cosmos

The diagram places sys-front-inj-logout in the Infinito.Nexus cosmos: the components it deploys (capabilities), the central services it consumes (dependencies), and its outward reach (federation and bridged external networks).

flowchart LR
    subgraph role [sys-front-inj-logout 💻]
        svc_logout["logout"]
    end

Solid 1:1 edges are fixed relationships; dashed 0..1 edges are conditional (enabled only in matching deployments); red 0..0 edges are turned off in this role. Node markers show the role’s deploy modes (💻 host, 🐳 compose, 🐝 swarm); ❌ marks a service that is explicitly turned off, and ⚙️ an Ansible role dependency declared in meta/main.yml.

Features

  • Seamless injection via NGINX sub_filter on </head>.

  • Automatic detection of various logout mechanisms (links, buttons, forms).

  • Centralized logout redirection for a unified user experience.

  • No changes required in application code.

  • Compatible with SPAs and dynamically generated content.

  • CSP‑friendly: manages script hash for you.

Further Resources

Credits

Implemented by Kevin Veen-Birkenbach. Part of the Infinito.Nexus Project and maintained by Kevin Veen-Birkenbach. Licensed under the Infinito.Nexus Community License (Non-Commercial).