exam questions

Exam 70-486 All Questions

View all questions & answers for the 70-486 exam

Exam 70-486 topic 1 question 19 discussion

Actual exam question from Microsoft's 70-486
Question #: 19
Topic #: 1
[All 70-486 Questions]

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:

Show Suggested Answer Hide Answer
Suggested Answer:
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;
}
}
}
}
Reference: Azure Acs plus asp.net MVC memberships
https://garvincasimir.wordpress.com/2011/08/06/azure-acs-plus-asp-net-mvc-memberships/

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
apostolin
Highly Voted 5 years, 10 months ago
1.IClaimsIdentity 2.ClaimType 3.ClaimTypes 4.ClaimType
upvoted 10 times
...
naga479
Most Recent 5 years, 4 months ago
provides answers are correct, i validated
upvoted 3 times
...
MaMa12345
5 years, 4 months ago
4 must be ClaimName, it compares with the string constant ACSProviderClaim defined at the top of the class.
upvoted 1 times
tanujgyan
5 years, 2 months ago
It should be ClaimType https://csharp.hotexamples.com/examples/-/IClaimsIdentity/-/php-iclaimsidentity-class-examples.html
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...