DRAG 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.
You have the following code:
Which code segments should you include in Target 1, Target 2, Target 3 and Target 4 to build the
class constructor? To answer, drag the appropriate code segment to the correct targets 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.
Answer: See the explanation
Explanation:
Target 1: IClaimsIdentity
Target 2: ClaimType
Target 3: ClaimTypes
Target 4: ClaimTypeExample: public class MyIdentityClaim
{
private string _identityProvider;
private string _identityValue ;
public const string ACSProviderClaim =
“http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider”;
public MyIdentityClaim(IClaimsIdentity identity)
{
if (identity != null)
{
foreach (var claim in identity.Claims)
{
if (claim.ClaimType == ClaimTypes.NameIdentifier)
{
_identityValue = claim.Value;
}
if (claim.ClaimType == ACSProviderClaim)
{
_identityProvider = claim.Value;
}
}
}}
Azure Acs plus asp.net MVC memberships
https://garvincasimir.wordpress.com/2011/08/06/azure‐acs‐plus‐asp‐net‐mvc‐memberships/