3.1.1.11.2.2 GetADSourcedClaims

 procedure GetADSourcedClaims (
     pADPrincipal : ADDRESS OF DSNAME,
     principalClass : ObjectClass,
     pAdSourcedClaims : ADDRESS OF CLAIMS_ARRAY)

This procedure is a helper routine that retrieves Active Directory-sourced claims (section 3.1.1.11.1.3) for a given principal from Active Directory using the Claims Dictionary (section 3.1.1.11.1.2).

pADPrincipal: The principal whose Active Directory claims are to be retrieved.

principalClass: The object class of the principal.

pAdSourcedClaims: The address of a CLAIMS_ARRAY structure used for the output Active Directory-sourced claims.

Return Values: This procedure does not return a value.

Logical Processing:

 bIssueClaim : boolean;
 claim: CLAIM_ENTRY;
 claimConfigContainer : DSName;
 bIssueClaim := FALSE;
 claim := null;
 pAdSourcedClaims^ := null;
 claimConfigContainer := DescendantObject( ConfigNC(),
     "CN=Claim Types, CN=Claims Configuration, CN=Services");
  
 pAdSourcedClaims^.usClaimsSourceType := CLAIMS_SOURCE_TYPE_AD;
 for (x in children claimConfigContainer)
     if (x!msDS-ClaimSourceType = "AD" &&
        x!msDS-ClaimTypeAppliesToClass in principalClass &&
        ValidateClaimDefinition(x))
          bIssueClaim := TRUE;
     endif
  
     if (bIssueClaim && pADPrincipal^!(x!msDS-ClaimAttributeSource) ≠ null)
          claim.Id := x!name;
          claim.Type := x!msDS-ClaimValueType;
          claim.ValueCount :=
            pADPrincipal^!(x!msDS-ClaimAttributeSource).count();
  
          if (x!msDs-ClaimAttributeSource.Syntax = 2.5.5.1)
             claim.Values :=
               pADPrincipal^!(x!msDS-ClaimAttributeSource)[].DN;
          else
             claim.Values := pADPrincipal^!(x!msDS-ClaimAttributeSource)[];
          endif
  
          pAdSourcedClaims^.ClaimEntries.Add(claim);
          pAdSourcedClaims^. ulClaimsCount :=
            pAdSourcedClaims^. ulClaimsCount + 1;
     endif
  
     claim := null;
     bIssueClaim := FALSE;
 endfor
 return;