SAML 2.0 AttributeConsumingService from B2C Custom Policy

330 Views Asked by At

I'm creating a SAML 2.0 Service Provider. The IDP i'm connecting to requires an AttributeConsumingService with the parameters listed below in the metadata:

<AttributeConsumingService index="0" isDefault="true">
   <ServiceName xml:lang="da">MyServiceName</ServiceName>
   <RequestedAttribute Name="https://data.gov.dk/model/core/specVersion" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true" />
   <RequestedAttribute Name="https://data.gov.dk/concept/core/nsis/loa" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true" />
   <RequestedAttribute Name="https://data.gov.dk/model/core/eid/professional/cvr" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true" />
   <RequestedAttribute Name="https://data.gov.dk/model/core/eid/professional/orgName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true" />
</AttributeConsumingService>

With my current setup this is not returned in my b2c service provider metadata.

How would i go about having my B2C custom policy creating this?

My custom policy:

<TechnicalProfile Id="NemLogin-SAML3">
   <DisplayName>NemLogin3</DisplayName>
   <Description>Login with your NemLogin3 account</Description>
   <Protocol Name="SAML2" />
   <Metadata>
      <Item Key="IssuerUri">myIssuerId</Item>
      <Item Key="PartnerEntity">https://www.nemlog-in.dk/media/zrrb0a1e/oio_saml_3_test-devtest4-idp-metadata-xml.txt</Item>
      <Item Key="NameIdPolicyFormat">urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</Item>
      <Item Key="ResponsesSigned">false</Item>
      <Item Key="WantsEncryptedAssertions">true</Item>
   </Metadata>
   <CryptographicKeys>
      <Key Id="SamlMessageSigning" StorageReferenceId="B2C_1A_Test" />
      <Key Id="SamlAssertionDecryption" StorageReferenceId="B2C_1A_Test" />
   </CryptographicKeys>
   <OutputClaims>
      <OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="assertionSubjectName" />
      <OutputClaim ClaimTypeReferenceId="specVersion" Required="true" />
      <OutputClaim ClaimTypeReferenceId="loa" Required="true" />
      <OutputClaim ClaimTypeReferenceId="cvr" Required="true" />
      <OutputClaim ClaimTypeReferenceId="orgName" Required="true" />
   </OutputClaims>
   <UseTechnicalProfileForSessionManagement ReferenceId="SM-Saml-idp" />
</TechnicalProfile>

Definition of claims in my policy:

<ClaimType Id="loa">
   <DisplayName>Level of assurance</DisplayName>
   <DataType>string</DataType>
   <DefaultPartnerClaimTypes>
      <Protocol Name="OpenIdConnect" PartnerClaimType="loa" />
      <Protocol Name="SAML2" PartnerClaimType="https://data.gov.dk/concept/core/nsis/loa" />
   </DefaultPartnerClaimTypes>
</ClaimType>

<ClaimType Id="cvr">
   <DisplayName>Cvr</DisplayName>
   <DataType>string</DataType>
   <DefaultPartnerClaimTypes>
      <Protocol Name="OpenIdConnect" PartnerClaimType="cvr" />
      <Protocol Name="SAML2" PartnerClaimType="https://data.gov.dk/model/core/eid/professional/cvr" />
   </DefaultPartnerClaimTypes>
</ClaimType>

<ClaimType Id="orgName">
   <DisplayName>Organisation Name</DisplayName>
   <DataType>string</DataType>
   <DefaultPartnerClaimTypes>
      <Protocol Name="OpenIdConnect" PartnerClaimType="orgName" />
      <Protocol Name="SAML2" PartnerClaimType="https://data.gov.dk/model/core/eid/professional/orgName" />
   </DefaultPartnerClaimTypes>
</ClaimType>

<ClaimType Id="specVersion">
   <DisplayName>Spec Version</DisplayName>
   <DataType>string</DataType>
   <DefaultPartnerClaimTypes>
      <Protocol Name="OpenIdConnect" PartnerClaimType="specVersion" />
      <Protocol Name="SAML2" PartnerClaimType="dk:gov:saml:attribute:SpecVer" />
   </DefaultPartnerClaimTypes>
</ClaimType>
0

There are 0 best solutions below