Skip to content

Conversation

@Alxandr
Copy link
Contributor

@Alxandr Alxandr commented Nov 25, 2025


This is part 2 of 2 in a stack made with GitButler:

Copilot finished reviewing on behalf of Alxandr November 25, 2025 19:50
Copy link
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 pull request introduces comprehensive platform access token handling functionality to the Altinn authorization framework. The implementation adds JWT-based token validation for platform-to-platform authentication, with support for multiple token issuers, certificate-based signing key validation, and seamless integration with ASP.NET Core authorization policies and Swagger/OpenAPI documentation.

Key Changes

  • Platform Access Token Infrastructure: New authorization requirements, handlers, and attributes for validating JWT-based platform access tokens with configurable issuer approval
  • Swashbuckle Integration: OpenAPI documentation support for platform access token authentication schemes
  • Security Normalization Improvements: Enhanced security requirement deduplication logic using HashSet-based comparisons to handle duplicate requirements more efficiently

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
SecurityInfoTests.cs Adds test case for duplicate security requirement handling
RequirementAuthorizationPolicySecurityProviderTests.cs Renames method to align with updated interface
DefaultPlatformAccessTokenHandlerTests.cs New comprehensive test suite for platform access token validation
ApprovedIssuersCheckTests.cs Tests for issuer validation logic
TestPlatformAccessTokenSigningKeyProvider.cs Mock implementation for certificate-based signing key provider
TestOptionsMonitor.cs Test helper for IOptionsMonitor implementation
TestHybridCache.cs Test implementation of HybridCache for .NET 9+
SwaggerPlatformAccessTokenRequirementConditionProvider.cs Maps platform token requirements to OpenAPI security schemes
SwaggerAnyOfScopeAuthorizationRequirementConditionProvider.cs Class renamed for consistency
AltinnSecurityOptions.cs Updates default values for platform token scheme
AltinnSwashbuckleServiceCollectionExtensions.cs Registers platform token condition provider
WellKnownPlatformAccessTokenIssuers.cs Enum for well-known platform token issuers
PlatformAccessTokenSigningKeyProvider.cs Azure Key Vault-based certificate retrieval
PlatformAccessTokenSettings.cs Configuration settings for platform token validation
PlatformAccessTokenRequirement.cs Internal authorization requirement implementation
IPlatformAccessTokenRequirement.cs Interface for platform token authorization requirements
PlatformAccessTokenAuthorizeAttribute.cs Attribute for platform token authorization
PlatformAccessTokenOrScopeAnyOfAuthorizeAttribute.cs Attribute for platform token OR scope authorization
PlatformAccessTokenOrScopeAnyOfAuthorizationRequirement.cs OR-based authorization requirement
DefaultPlatformAccessTokenHandler.cs Core JWT validation handler
IPlatformAccessTokenSigningKeyProvider.cs Interface for certificate key providers
BasePlatformAccessTokenSigningKeyProvider.cs Base implementation with caching support
ApprovedIssuersCheck.cs Issuer validation logic with optimized lookups
AltinnServiceDefaultsAuthorizationServiceCollectionExtensions.cs DI registration for platform token handlers
AltinnAuthorizationPolicyBuilderExtensions.cs Extension methods for policy configuration
SecurityInfo.cs Improved security requirement normalization with HashSet deduplication
OpenApiAuthorizationRequirementConditionProvider.cs Method renamed for clarity
Directory.Packages.props Package version definitions for new dependencies
Altinn.Authorization.ServiceDefaults.Authorization.csproj Project dependencies for platform token support
ResourceController.cs Sample API demonstrating platform token authorization
AdminController.cs Sample API with platform token attribute

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Alxandr Alxandr force-pushed the feat/platform-access-token-handling branch 3 times, most recently from 4a48857 to d411151 Compare November 25, 2025 20:26
@Alxandr Alxandr force-pushed the feat/platform-access-token-handling branch from d411151 to a24e642 Compare November 26, 2025 08:10
@sonarqubecloud
Copy link

Copy link
Member

@TheTechArch TheTechArch left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants