[WIP] feat: Add support for legacy enterprise users #634
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This add support for Altinn 2 legacy enterprise users ("virksomhetsbrukere")
Description
This introduces the concept of "user types", and generalizes
IUserNameRegistry
in order to support legacy Altinn 2 enterprise users, and adds additional extension methods inClaimsPrincipalExtensions
. This should lay some of the ground work required to support the new system users.This means we no longer require a
pid
claim to be present in EU-endpoints requiring authorization; aurn:altinn:userId
+urn:altinn:username
or valid org. number inconsumer
will be deemed sufficient, and will cause a authorization request to be made. Altinn Authorization already utilizesurn:altinn:userid
when enriching the request with roles if a resource party is supplied, so this makes it possible to use enterprise users (which don't have apid
claim) to use Dialogporten.Allowing just a
consumer
claim will open for XACML policies with rules identifying specific organization numbers. This is not used in Altinn-contexts today, but it makes little sense to actively not support it as it might be more relevant in services external to Altinn.This also introduces middleware to validate whether a valid user type is present.
IUserNameRegistry
and handlers have been refactored to assume that this is handled.Tasks/considerations
Related Issue(s)
Verification
Documentation
docs
-directory, Altinnpedia or a separate linked PR in altinn-studio-docs., if applicable)