asp.net - Bypassing forms authentication when a query string is passed -
in asp.net, aware of way bypass forms authentication if specific query string parameter passed in?
such as:
mydomain.com/myprotectedpage.aspx
...i protected forms authentication (and so, redirected login page)
mydomain.com/myprotectedpage.aspx?mybypassparameter=me
...i page render normal
is @ possible?
not "official" way of doing it.
you do, have base page instead of system.web.ui.page so:
public mustinherit class protectedpage inherits system.web.ui.page private sub page_initcomplete(byval sender object, byval e system.eventargs) handles me.initcomplete if user.identity.isauthenticated = false if string.isnullorempty(request.querystring("mybypassparameter")) formsauthentication.redirecttologinpage() end if end if end sub
end class
Comments
Post a Comment