DRAG DROP
You are developing an ASP.NET Web API for a home inventory management system You need to limit access to users with IP addresses based only in the United States. You have the following code:
Which code segments should you include in Target 1 and Target 2 to complete the code? (To answer, drag the appropriate code segments to the correct targets in the answer area. Each code segment may be used once, more than once, or nor at all. You may need to drag the split bar between panes or scroll to view content.)
Select and Place:
agreed with Bubbles:
target 1: AuthorizeAttribute
Source:
https://gist.github.com/rdingwall/2028849
Target 1: AuthorizeAttribute
Wrong. The AuthorizationFilterAttribute is a correct anwer. It has OnAuthorize method, while AuthorizeAttribute has Users and roles.
Sorry, OnAuthorize has both classes, but
AuthorizationFilterAttribute – doens’t require authorization based on roles (we need IP) while
AuthorizeAttribute – authorization based on roles only
AuthorizationFilterAttribute is correct