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

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -