PUBLIC BETA OFFER

Save 50% off on an Eligible Learning PlanValid for 1-month plan, 3-month plan, 12-month plan · Code LPXBETA50 · Ends Dec 6, 2026

Design and implement authentication and authorization methods

Bind workload identity, trust and effective permissions separately

Choose workload identities by hosting and lifecycle, configure precise federated trust, and govern service connections for their actual consumers. Distinguish token capability, resource permission, feature entitlement and project/team context; inspect issued claims and dated cutover guidance rather than guessing validity.

Knowledge domain
Design and implement a security and compliance plan (15–20%)
Topics & tags
Published
Author
LearningPathX Editorial TeamContent version 1.0
Resources

Design and implement authentication and authorization methods

Learning objectives

  • Select a workload identity according to hosting, lifecycle and privilege separation.
  • Match GitHub tokens and federated trust to the actual actor and context.
  • Configure governed service connections without confusing them with resource authorization.
  • Separate entitlement, effective permission, project and team boundaries.

Select identity by lifecycle

An application service principal represents an application in a Microsoft Entra tenant. A managed identity is a service principal whose credential lifecycle Azure manages. Neither automatically receives subscription or vault access. Creating the identity, authenticating the workload and authorizing its resource operation are separate steps.

A system-assigned managed identity fits a supported resource whose identity should share its lifecycle. Enable it, identify its principal and assign the narrow downstream role. Deleting the resource removes that identity; recreating the same resource name does not recreate the same principal. A user-assigned identity exists independently and can attach to multiple supported resources. Create/select it, attach it, select the intended identity during token acquisition and grant target access. Sharing also shares its privilege boundary, so materially different privileges can warrant separate identities.

For a disposable VM reading a vault, a system identity may fit. A replacement-prone fleet requiring a stable principal may fit a user-assigned identity. If token acquisition succeeds but vault access fails, inspect target authorization and network reach before changing identity type. Outside supported managed-identity hosting, use an application identity with supported authentication, preferably federation over a long-lived stored secret. Federation may target a user-assigned identity, but it is not an Azure-hosted process using the managed-identity endpoint.

Match GitHub credentials to their actor

Mechanism Role and constraint
GitHub App JWT Authenticates the App, including obtaining an installation token; it is not the ordinary installed-resource token.
Installation token Acts as the installed App within its repositories and granted permissions.
App user token Acts for a particular user and remains constrained by that user's authority.
GITHUB_TOKEN Supports workflow operations under selected job/workflow permissions.
PAT Supports personal API/CLI use where suitable alternatives do not fit, bounded by the owner's access.

An authorized issue-creating job can set permissions: {contents: read, issues: write} and pass ${{ secrets.GITHUB_TOKEN }} as the CLI's GH_TOKEN environment variable. Check the actual repository and returned issue identity. A read-only job should not inherit that write capability. An action can access github.token implicitly, so omitting an explicit token input does not isolate it.

For persistent organization automation, a GitHub App can avoid dependence on an employee PAT. Define minimal permissions, install only on intended repositories, obtain the installation token and call the corresponding API. Use user authorization when the operation must represent a user.

Fine-grained PATs restrict owner, repositories and permissions more precisely than classic scopes, but endpoint support is not universal. The adopted material records user-owned Projects and cross-organization limitations. Check the endpoint and organization approval policy. Use a finite lifetime, protected storage and replacement/revocation plan for any necessary PAT. Losing owner access affects both kinds; creating a token proves neither repository permission nor API success.

Configure precise federated trust

Workload identity federation replaces a stored application secret with a trusted assertion. Bind issuer, subject and audience to the receiving application or user-assigned identity. Assign its Azure roles and authorize the intended pipeline. Secretless authentication still needs resource authorization, network access and applicable approvals.

In GitHub Actions, id-token: write permits requesting an OIDC token; it grants no Azure write rights. Login must use the intended client, tenant, subscription and audience, with the actual repository/branch or environment claims. Protected environments complement rather than replace cloud trust.

The adopted GitHub.com behavior is date-sensitive. Repositories created after July 15, 2026, or renamed/transferred after that date, use an immutable default subject incorporating owner and repository IDs. Earlier repositories retain the prior form unless opted in. The rollout excludes GitHub Enterprise Server. Illustrative forms are:

repo:example-org/example-repo:ref:refs/heads/main
repo:example-org@123456/example-repo@456789:ref:refs/heads/main

Inspect actual issued claims instead of copying those example names/IDs. An environment subject is not a branch subject. Establish correct replacement trust, verify login and authorized resource access, then retire obsolete trust. Broad wildcard trust is not a sound repair for mismatched claims.

For ADO's documented automatic route, use Project settings → Service connections → New service connection → Azure Resource Manager → App registration (automatic) → Workload identity federation. Select target scope/subscription and optional resource group, name the connection, authorize intended pipelines and save. Subscription Owner and cloud/task compatibility restrictions apply to this automatic method, not every manual or existing-identity route. An existing user-assigned identity route selects that identity and its Azure scope. Token-exchange failure suggests trust/identity mismatch; a subsequent resource denial points to authorization or service/network access.

Work through the subject-format date boundary

For these documentary cases, the deciding date is the repository's creation, rename or transfer date, together with any opt-in and its actual GitHub deployment/context. The adopted excerpt says after July 15, 2026 but gives no exact cutoff instant or timezone. Do not invent an inclusive instant for the boundary day. Inspect the issued subject before configuring trust in every case; these are expected decisions from the source snapshot, not observed token results.

Illustrative input Expected decision
GitHub.com repository created on 2026-07-14, with no later qualifying rename/transfer and no opt-in The adopted prior-format rule is the starting expectation; verify the actual issued subject before creating trust.
A qualifying repository action dated 2026-07-15 The excerpt does not settle the exact boundary-day instant. Inspect actual claims and applicable rollout information; do not select a trust format from that date alone.
GitHub.com repository created, renamed or transferred on 2026-07-16 The adopted after-date rule describes the owner/repository-ID-containing default. Verify the actual names, IDs, audience and branch/environment context rather than copying the sample.
Creation/rename/transfer history or opt-in status is missing Do not infer the format. Retrieve the relevant metadata and issued claims before configuring or changing trust.

GitHub Enterprise Server remains outside this documented rollout. An earlier creation date alone is insufficient if a later rename, transfer or opt-in changed the applicable context.

Govern service connections separately from tokens

A service connection names an endpoint/identity configuration for pipeline tasks. It is neither simply a PAT nor permission for every pipeline. In Project settings → Service connections, choose the service type/authentication, endpoint, scope, identity and name, then Verify/Save where supported. Reference the actual name through the task's corresponding input, such as azureSubscription.

Connection user roles, permitted pipelines and Approvals and checks are distinct. Inspect Overview for identity/type and Usage history for consumers. Verify performs its particular REST check; it does not establish full deployment success. Disable only after coordinating dependent consumers and replacement resource roles. Authorize intended pipelines instead of unnecessarily granting all-pipeline access.

When a tool cannot use supported Entra authentication, create an organization-scoped PAT through User settings → Personal access tokens → New Token. Select organization, name, expiry and minimum scopes, and securely retain the once-shown value. Agent registration needs its applicable Agent Pools scope, not blanket repository administration. That credential is not automatically the agent's runtime identity.

The source verified on 2026-11-14 states that global PATs stop working January 27, 2027. This is dated implementation guidance, not a claim that every token is already invalid. Inventory consumers, move them to supported organization-scoped or Entra authentication, verify them, then retire old credentials. Diagnose expiry/revocation, owner access, organization policy and wrong scope separately before regenerating.

Plan the global-PAT cutover without inventing a live validity test

The following date-only planning cases use the adopted January 27, 2027 stop date for global PATs. The excerpt supplies no exact service cutoff time or timezone. The decisions therefore concern migration readiness, not a claim that a particular request was tested or every PAT type expires at that instant.

Illustrative input Expected decision
A known global PAT considered on 2027-01-26 Do not assume it is valid: expiry, revocation, owner access, scope and policy still apply. Complete and verify its supported replacement before the stated stop date.
A known global PAT considered on 2027-01-27 Plan without relying on that token under the source's stop-date guidance. Use the verified supported replacement and inspect any actual authentication result separately.
A known global PAT considered on 2027-01-28 Continue with a verified organization-scoped or supported Entra replacement; do not restore the retired global-token dependency.
Token kind, consumer identity or applicable cutoff information is missing Inventory the consumer and identify its token/policy before deciding. Do not label an unknown or organization-scoped PAT invalid solely from the global-PAT note.

If an exact transition instant is operationally necessary, obtain the applicable service policy and observe the authorized consumer; the date-only excerpt does not supply that precision. Keep credential values out of diagnostics.

Separate feature entitlement from effective access

ADO's main access levels are Stakeholder, Basic, and Basic + Test Plans. They control feature entitlement. Membership, object permissions and inheritance control operations. A missing portfolio/test-management capability can need entitlement correction; a denied repository action needs its effective object permission examined independently.

Inspect direct and group assignments at the failing scope. Not set is not explicit Deny. Same-scope Deny generally overrides another group's Allow, while explicit child settings and inheritance require separate evaluation. Do not claim every inherited Deny defeats every explicit child setting. Verify as the intended user, not as an owner.

GitHub repository, organization, team and Projects roles are separate. In the adopted repository taxonomy, Read supports viewing/discussion; Triage adds proactive issue/discussion/PR management without code write; Moderate adds moderation/editing without code write; Write enables code contribution; Maintain manages the repository except sensitive/destructive administration; Admin includes those actions. Moderate does not push, merge or approve required reviews. Check specific capability rows rather than assuming a perfectly monotonic hierarchy, especially for packages/rulesets. Repository access is not a Projects role.

Offboarding needs independent review of deploy keys, tokens and installations. Removing membership does not itself revoke a private deploy key. Preserve legitimate shared automation while retiring the actual unwanted access.

Configure project and team context

An ADO project groups repositories, boards, pipelines and related work. Project creation needs collection-level creation authority; Project Administrator within one project does not automatically grant creation of another. Select the organization, project name, initial source-control type and work-item process, then establish membership.

Creating a team requires Project Administrators membership. Configuring or adding members to an existing team allows its Team administrator or Project Administrators. Use Project settings → Teams → New team, enter Name, select Members, add at least one Administrator, and choose a named area path or assign one later. After Create, configure Iterations and areas. Verify the actual project/team and visible backlog. A new team is neither a new project nor an access-level entitlement.

GitHub Projects organizes issues, PRs and draft ideas without creating a repository. Choose organization or personal ownership, then Projects → New project, and select Table, Roadmap, Board or a template. Inspect generated fields, views, workflows and insights. An organization setup can optionally import a repository's existing/new items and make it default; avoid that broad import for a deliberately selective backlog. Set description and README in Settings.

Visibility and roles are independent. Owner/admin authority controls Settings → Danger zone → Visibility, subject to organization restrictions. A public Project still does not reveal private-repository items. Manage access sets organization base No access, Read, Write or Admin plus explicit team/user grants. Lowering base access does not remove owner privileges or explicit grants. Organization invitees must be members or outside collaborators on an organization repository; personal Projects invite individuals. Check the intended viewer/editor and keep inaccessible private items hidden. A locked item is not evidence of deletion, and a Project invitation grants no repository permission.

Summary

Select identities from lifecycle and hosting, then configure token/trust and resource permission separately. Govern service connections for their actual consumers, distinguish entitlement from object access, and verify project/team context as the intended actor. Authentication, configuration and an allowed business operation require different evidence.

PUBLIC BETA OFFER

Save 50% off on an Eligible Learning Plan

Valid for 1-month plan, 3-month plan, 12-month plan · Code LPXBETA50 · Ends Dec 6, 2026

Ready to put this into practice?

Start guided practice →