ASP.NET MVC attribute

Cantor, Scott cantor.2 at osu.edu
Fri Nov 18 16:58:27 GMT 2011


On 11/18/11 11:43 AM, "VanFosson, Timothy L" <timothy-vanfosson at uiowa.edu>
wrote:

>I¹m new to the list so forgive me if this isn¹t an appropriate request.

This is the right list for the topic.

> 
>I¹m about to implement a Shibboleth-protected site that uses ASP.NET MVC.
> I realize that I can use the existing ISAPI filter to protect various
>components of the site, but I¹d like to still with the MVC
>convention-based approach and use
> an AuthorizeAttribute (or a derived class based on that) that does the
>same work as the ISAPI filter,

The filter doesn't do anything but implement a C++ interface to expose the
web server internals in a portable way to the rest of the SP library. In
other words, it isn't likely that you can directly build anything
analagous if the integration point is fundamentally different.

There's also the managed vs. unmanaged code issue, but that's possibly
tractable.

>Does anyone know of such an attribute? If not, are there any resources
>you can point me to (other than the source, which I have) that will help
>me understand the workflow of the filter so I can implement it as an
>attribute-based filter on my methods?

I have no documentation, the project has not prioritized its creation. All
of the public APIs have doxygen docs that can be generated, but as far as
the design, there's nothing.

You will find, however, that the filter (and extension) source is not long
and I think quickly grasp what it's actually doing. The bodies of the
actual filter and extension hooks are maybe 20-50 lines of code.

I think it would end up being necessary to design a different API between
the library and this thing you're talking about. And the system still
requires the ISAPI extension, and right now, the extension only functions
if the filter is in place and handles the initialization process of the
code. That's fixable, just pointing it out.

-- Scott



More information about the dev mailing list