Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
    <!-- Swedish eID Framework, personalIdentityNumber. Release ThisnorEduPersonNIN attributeif SHALLit only contain Swedish personcontains numbers (filter out interim numbers) -->
    <AttributeDefinition xsi:type="ScriptedAttributeRegexSplit" id="personalIdentityNumber">
        <InputAttributeDefinition ref="norEduPersonNIN" />
        <Script>
         <![CDATA[
                // Script to take a person number and filter out interim numbers (containing letters)
                nin=norEduPersonNIN.getValues().get(0)
                if (nin.matches("^(18|19|20)?[0 regex="^((18|19|20)?[0-9]{2}((0[0-9])|(10|11|12))((([0-2][0-9])|(3[0-1]))|((6[1-9])|([7-8][0-9])|(9[0-1])))[0-9]{4}$")) {
                        personalIdentityNumber.getValues().add(nin)
                }])))[0-9]{4})$">
         ]]>
        </Script><InputAttributeDefinition ref="norEduPersonNIN"/>
        <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:personalIdentityNumber" encodeType="false" />
        <AttributeEncoder xsi:type="SAML2String" name="urn:oid:1.2.752.29.4.13" friendlyName="personalIdentityNumber" encodeType="false" />
    </AttributeDefinition>

...