Enforce MFA and conditional access policies when required by governance.
Provide RBAC aligned with PackagingTools personas (Developer, Release Engineer, Security Officer, Administrator).
Core Components
Identity Service Abstraction – PackagingTools.Core.Security.Identity.IIdentityService mediates authentication flows. Implementations can delegate to Azure AD (MSAL) or Okta (OIDC/OAuth). The default implementation returns a service principal for offline scenarios.
Identity Models – IdentityRequest, IdentityResult, IdentityToken, and IdentityPrincipal carry provider metadata, tokens, claims, and role assignments.
Developer – Run local packaging, view run history.
Token Handling – Access tokens stored in secure store (e.g., FileSecureStore/local secrets) with short TTL and refresh tokens when workflows require long-lived sessions.
MFA Enforcement – IdentityRequest.RequireMfa indicates operations requiring MFA (e.g., policy approval). Providers surface MFA claims which the policy engine validates before continuing.
Provider Integration
Azure Active Directory
Use OAuth 2.0/OIDC with MSAL.
Acquire tokens for API scopes such as api://packagingtools/run, api://packagingtools/approve.
Support device code flow in CLI and interactive flow in GUI.
Validate Conditional Access claims; ensure mfa or deviceid present when required.
Okta
Use OIDC PKCE flow.
Map Okta groups to PackagingTools roles.
Retrieve id_token for profile info, access_token for API calls.
Evaluate Okta ThreatInsight events to block risky logins.