Skip to content

Remove legacy auth request-path references from workflow examples and example scripts#266

Merged
blindzero merged 2 commits intomainfrom
copilot/remove-legacy-auth-references
Mar 15, 2026
Merged

Remove legacy auth request-path references from workflow examples and example scripts#266
blindzero merged 2 commits intomainfrom
copilot/remove-legacy-auth-references

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 15, 2026

Workflow examples were using {{Request.Auth.*}} and {{Request.Intent.Auth.*}} template paths for AuthSessionName, embedding auth session selection into request data — inconsistent with the current model where AuthSessionName is a fixed string in the workflow.

Changes

  • examples/workflows/templates/ad-joiner.psd1 — Replace 9 occurrences of AuthSessionName = '{{Request.Auth.Directory}}' with AuthSessionName = 'Directory', matching the pattern already used in ad-leaver.psd1 and all other templates.

  • examples/workflows/templates/ad-joiner-entraconnect-entraid.psd1 — Replace AuthSessionName = '{{Request.Intent.Auth.Directory}}' with AuthSessionName = 'Directory' for the same reason.

  • examples/Invoke-LeaverWithManagerOOF.ps1 — Replace New-IdleAuthSessionBroker (internal IdLE.Core function) with New-IdleAuthSession (the public API exported by IdLE); rename $authBroker$authSessionBroker to match the walkthrough docs.

Before / after (ad-joiner.psd1):

- AuthSessionName = '{{Request.Auth.Directory}}'
+ AuthSessionName = 'Directory'

Before / after (Invoke-LeaverWithManagerOOF.ps1):

- $authBroker = New-IdleAuthSessionBroker `
+ $authSessionBroker = New-IdleAuthSession `
      -AuthSessionType 'OAuth' `
      -DefaultAuthSession ([pscustomobject]@{ Token = 'mock-token' })

  $providers = @{
      ExchangeOnline    = $exoProvider
-     AuthSessionBroker = $authBroker
+     AuthSessionBroker = $authSessionBroker
  }
Original prompt

This section details on the original issue you should resolve

<issue_title>Docs/Examples: Remove remaining legacy auth references and align workflow examples with AuthSessionName/AuthSessionBroker terminology</issue_title>
<issue_description>## Problem Statement

The repository has already moved toward the current provider/auth model, but some documentation and examples still appear to contain older auth terminology or outdated request-path usage.

This creates avoidable confusion because users now have to distinguish between the intended model and legacy-looking examples. In particular, workflow examples should consistently reflect the current naming and object model:

  • provider auth broker configuration belongs to Providers.AuthSessionBroker
  • step/runtime selection belongs to With.AuthSessionName
  • optional runtime tuning belongs to With.AuthSessionOptions

Any remaining examples using older naming or old request paths make it harder for users to understand the supported pattern.

Proposed Solution

Perform a focused repository-wide cleanup for provider/auth naming and related examples.

Scope:

  • Review docs, examples, and inline sample content for outdated auth naming.
  • Replace remaining legacy-looking references with the current terminology:
    • AuthSessionBroker
    • AuthSessionName
    • AuthSessionOptions
  • Review workflow template examples for outdated auth request paths and update them to the current supported model.
  • Ensure provider docs and workflow examples use the same wording and structure.
  • Add or update tests where example validation exists.

This should be treated as a consistency and completeness issue, not as a redesign.

Alternatives Considered

Alternative A: Leave mixed terminology in place and rely on user interpretation

This was rejected because it increases cognitive load and makes the documentation less trustworthy.

Alternative B: Add compatibility notes everywhere old wording appears

This was rejected because the goal should be one consistent current model, not parallel terminology.

Alternative C: Defer cleanup until a larger documentation rewrite

This was rejected because the inconsistency already affects current examples and can mislead users today.

Impact

  • Does this affect existing workflows?

    • Documentation-only and example-only changes should not affect working user workflows.
    • If example validation is introduced or tightened, outdated examples in the repository may need to be updated.
  • Any backward compatibility concerns?

    • No runtime compatibility concerns are expected if this remains limited to docs/examples.
    • The only visible change is clearer terminology and more deterministic examples.

Additional Context

Suggested acceptance criteria:

  1. Repository-wide search no longer finds outdated auth terminology in user-facing docs/examples where the current model should be shown.
  2. Provider docs consistently describe broker configuration and runtime selection using the current names.
  3. Workflow examples use current request/context access patterns and do not reference obsolete auth path styles.
  4. Examples remain syntax-correct and internally consistent.
  5. If repository checks exist for examples/docs, they pass after the cleanup.

Suggested review targets:

  • provider documentation
  • workflow template examples
  • quickstart/reference/how-to examples
  • inline example snippets in markdown files
    </issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

… align host script with public API

Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove legacy auth references from documentation Remove legacy auth request-path references from workflow examples and example scripts Mar 15, 2026
Copilot AI requested a review from blindzero March 15, 2026 15:11
@blindzero blindzero marked this pull request as ready for review March 15, 2026 16:02
Copilot AI review requested due to automatic review settings March 15, 2026 16:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates user-facing workflow templates and example scripts to remove legacy Request.Auth.* / Request.Intent.Auth.* template references and align examples with the current auth model: With.AuthSessionName as a fixed string and host-provided Providers.AuthSessionBroker via the public API.

Changes:

  • Update AD joiner workflow templates to use AuthSessionName = 'Directory' instead of legacy request-path templating.
  • Update Entra Connect + Entra ID joiner template to use the same fixed AuthSessionName pattern.
  • Update the leaver example script to use the public New-IdleAuthSession wrapper instead of the internal New-IdleAuthSessionBroker, and rename the variable accordingly.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
examples/workflows/templates/ad-joiner.psd1 Replaces legacy {{Request.Auth.Directory}} auth-session templating with fixed AuthSessionName = 'Directory'.
examples/workflows/templates/ad-joiner-entraconnect-entraid.psd1 Replaces {{Request.Intent.Auth.Directory}} with fixed AuthSessionName = 'Directory' for the Directory provider step.
examples/Invoke-LeaverWithManagerOOF.ps1 Uses New-IdleAuthSession (public API) and updates provider map to use $authSessionBroker.

@github-actions
Copy link
Copy Markdown

Code Coverage Report

Overall Project 74.74% 🍏

There is no coverage information present for the Files changed

@blindzero blindzero merged commit d884608 into main Mar 15, 2026
9 checks passed
@blindzero blindzero deleted the copilot/remove-legacy-auth-references branch March 22, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs/Examples: Remove remaining legacy auth references and align workflow examples with AuthSessionName/AuthSessionBroker terminology

3 participants