<

Question 32


70-486 Skills Measured >> 5.5 Design and Implement Security >>

Question

Drag and Drop
You are developing an ASP.NET MVC application that authenticates a user by using claims-based authentication.

The application must:
  • Use Windows Identity Foundation 4.5.
  • Support the Windows Azure Access Control Service.
You need to implement authentication. How should you build the class constructor?
(To answer, drag the appropriate code segment to the correct location or locations in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

  • ClaimNames
  • ClaimTypes
  • IIdentityClaims
  • ClaimsIdentity
  • ClaimType
  • ClaimName
  • ClaimType
  • ClaimName
using Microsoft.IdentityModel.Claims;

public class IdentityClaim
{
private string _identityProvider;
private string _identotyValue;
public const string ACSProviderClaim = "http://schemas.micorosft.com/accesscontrolservice/...";
public IdentityClaim(
    identity) {
    if (identity !=null) {
    foreach (varclaim in identity.Claims) {
    if (claim.
      ==
        .NameIdentifier)
        {
        _identityValue = claim.Value;
        }
        if (claim.
          == ACSProverClaim)
          {
          _identityProvider = claim.Value;
          }
          }
          }
          }
          }

          Answer:

          • ClaimNames
          • ClaimsIdentity
          • ClaimName
          • ClaimName
          using Microsoft.IdentityModel.Claims;

          public class IdentityClaim
          {
          private string _identityProvider;
          private string _identotyValue;
          public const string ACSProviderClaim = "http://schemas.micorosft.com/accesscontrolservice/...";
          public IdentityClaim(
          • IIdentityClaims
          identity) {
          if (identity !=null) {
          foreach (varclaim in identity.Claims) {
          if (claim.
          • ClaimType
          ==
          • ClaimTypes
          .NameIdentifier)
          {
          _identityValue = claim.Value;
          }
          if (claim.
          • ClaimType
          == ACSProverClaim)
          {
          _identityProvider = claim.Value;
          }
          }
          }
          }
          }
          Note: System.IdentityModel is obsolete