How should you build the class constructor?

HOTSPOT
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, select the appropriate option from the drop-down list
in the answer area.)
Hot Area:

HOTSPOT
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, select the appropriate option from the drop-down list
in the answer area.)
Hot Area:

Answer:

Explanation:
Target 1: ClaimsIdentity
Target 2: ClaimType
Target 3: ClaimTypes
Target 4: ClaimType
Example: 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/



Leave a Reply 0

Your email address will not be published. Required fields are marked *