Skip to content

p2-inc/keycloak-skills / benchmarks/keycloak-magic-link-org-restrict-login/environment/skills/magicLinkOrgRestrictLoginMcp

magicLinkOrgRestrictLoginMcp

Verified

Restrict passwordless magic-link login so only members of a specific organization ever receive the login link, on a Phase Two hosted Keycloak, using the Keycloak MCP server. Use this whenever someone wants "magic link login restricted to org X", "passwordless login gated by organization membership", "only email the login link to people on this team", or describes a user logging in via magic link where whether they get in depends on their organization membership (as signalled by account_hint). This is NOT plain magic-link with no restriction (a simpler, different flow), and NOT the org gate on a password login (a different flow with no magic-link step at all) — it is the combination of both, via a custom flow authored with importAuthenticationFlow that runs the membership check BEFORE the login email is sent. Covers the load-bearing execution order and the `account_hint`/`prompt=select_account` trigger requirement.

assets/select-organization-magic-link.partial-import.json

View on GitHub
{
  "ifResourceExists": "SKIP",
  "authenticationFlows": [
    {
      "alias": "Select organization magic link",
      "description": "Magic-link authentication flow gated on organization membership.",
      "providerId": "basic-flow",
      "topLevel": true,
      "builtIn": false,
      "authenticationExecutions": [
        {
          "authenticator": "auth-cookie",
          "authenticatorFlow": false,
          "requirement": "ALTERNATIVE",
          "priority": 0,
          "userSetupAllowed": false
        },
        {
          "authenticator": "identity-provider-redirector",
          "authenticatorFlow": false,
          "requirement": "ALTERNATIVE",
          "priority": 10,
          "userSetupAllowed": false
        },
        {
          "authenticatorFlow": true,
          "requirement": "ALTERNATIVE",
          "priority": 20,
          "flowAlias": "Select organization magic link magic link forms",
          "userSetupAllowed": false
        }
      ]
    },
    {
      "alias": "Select organization magic link magic link forms",
      "description": "Forms for the org-gated magic-link authentication flow.",
      "providerId": "basic-flow",
      "topLevel": false,
      "builtIn": false,
      "authenticationExecutions": [
        {
          "authenticator": "ext-auth-username-auth-note",
          "authenticatorConfig": "set-context",
          "authenticatorFlow": false,
          "requirement": "REQUIRED",
          "priority": 0,
          "userSetupAllowed": false
        },
        {
          "authenticator": "ext-select-org",
          "authenticatorConfig": "match-by-name",
          "authenticatorFlow": false,
          "requirement": "REQUIRED",
          "priority": 1,
          "userSetupAllowed": false
        },
        {
          "authenticator": "ext-magic-form",
          "authenticatorConfig": "magic-link-existing-accounts-only",
          "authenticatorFlow": false,
          "requirement": "REQUIRED",
          "priority": 2,
          "userSetupAllowed": false
        }
      ]
    }
  ],
  "authenticatorConfig": [
    {
      "alias": "set-context",
      "config": {
        "setUserInContext": "true"
      }
    },
    {
      "alias": "match-by-name",
      "config": {
        "match_by_org_name": "true"
      }
    },
    {
      "alias": "magic-link-existing-accounts-only",
      "config": {
        "ext-magic-create-nonexistent-user": "false"
      }
    }
  ]
}
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall