Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,11 @@ ProviderTypes.Contentful or ProviderTypes.Smartsheet

// HubSpot returns the username as a custom "user" node:
ProviderTypes.HubSpot => (string?) context.UserInfoResponse?["user"],

// ID Austria returns a "given_name" and "family_name" node
ProviderTypes.IdAustria when context.BackchannelIdentityTokenPrincipal?.HasClaim("given_name") is true &&
context.BackchannelIdentityTokenPrincipal?.HasClaim("family_name") is true
=> $"{context.BackchannelIdentityTokenPrincipal?.GetClaim("given_name")} {context.BackchannelIdentityTokenPrincipal?.GetClaim("family_name")}",

// Mailchimp returns the username as a custom "accountname" node:
ProviderTypes.Mailchimp => (string?) context.UserInfoResponse?["accountname"],
Expand Down Expand Up @@ -1679,6 +1684,17 @@ ProviderTypes.Webflow or ProviderTypes.Weibo or ProviderTypes.Yandex
context.MergedPrincipal.AddClaim(ClaimTypes.NameIdentifier, value, issuer);
}
}

// Force override NameIdentifier claim for ID Austria
// In MapStandardWebServicesFederationClaims, Subject is mapped to NameIdentifier.
// ID Austria's documentation specifies the "sub" node to be a transient value, and refers
// to using their custom "bPK" for recognizing users across logins instead.
if (context.Registration.ProviderType is ProviderTypes.IdAustria)
{
context.MergedPrincipal.SetClaim(ClaimTypes.NameIdentifier,
context.BackchannelIdentityTokenPrincipal?.GetClaim("urn:pvpgvat:oidc.bpk") ??
context.FrontchannelIdentityTokenPrincipal?.GetClaim("urn:pvpgvat:oidc.bpk"));
}

return ValueTask.CompletedTask;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,26 @@
</Environment>
</Provider>

<!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▄ ▄██ ▄▄▀███ ▄▄▀██ ██ ██ ▄▄▄ █▄▄ ▄▄██ ▄▄▀█▄ ▄█ ▄▄▀██
██ ███ ██ ███ ▀▀ ██ ██ ██▄▄▄▀▀███ ████ ▀▀▄██ ██ ▀▀ ██
█▀ ▀██ ▀▀ ███ ██ ██▄▀▀▄██ ▀▀▀ ███ ████ ██ █▀ ▀█ ██ ██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
-->

<Provider Name="IdAustria" Id="3d66449c-ce7b-46cf-b2f2-6c1fb81bb5fd" Documentation="https://www.id-austria.gv.at/de/developer">
<!-- The profile scope is technically not required, but documentation strongly suggests it.
Also, without the profile scope set, this provider returns no useful claims,
including the custom "urn:pvpgvat:oidc.bpk" claim needed as substitute for the sub claim. -->
<Environment Name="Production" Issuer="https://idp.id-austria.gv.at/">
<Scope Name="profile" Default="true" Required="true"/>
</Environment>
<Environment Name="Reference" Issuer="https://idp.ref.id-austria.gv.at/">
<Scope Name="profile" Default="true" Required="true"/>
</Environment>
</Provider>

<!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█████ ██ ██ ██ ▄▀▄ ██ ▄▄ ██ ▄▄▀██ █████ ▄▄▄ ██ ██ ██ ▄▄▀██
Expand Down