forms-authentication

Mixed Forms and LDAP authentication with auto-registration with ASP.NET MVC.

Hi, I need to use Form-Based authentication on an ASP.NET MVC web site with LDAP (Active Directory) backend like TeamCity for instance. So i need to query LDAP first if the requested user is valid, then auto-register user in database according to LDAP user authentication infos in order to use mixed authentication : Users : Admin (loc...

ValidateUser of Forms Authentication issue

Hello everyone, I am using SharePoint 2007 Enterprise + Publishing portal template + Windows Server 2008. And I am developing using ASP.Net + C# + .Net 3.5 + VSTS 2008 on SharePoint Server 2007. I am developing a custom Forms authentication based on Forms authentication interface. I am learning using Forms Authentication with SharePoint...

Forms authentication login page issue

Hello everyone, I am using SharePoint 2007 Enterprise + Publishing portal template + Windows Server 2008. And I am developing using ASP.Net + C# + .Net 3.5 + VSTS 2008 on SharePoint Server 2007. I am developing a custom authentication provider based on Forms authentication. When an anonymous access a page which needs authentication, by ...

My.User.IsAuthenticated bug in WPF

I don't know exactly how to explain it, but here is basically how my problem could be reproduced: Create a WPF Windows Application Project in VB.NET (don't create, just keep reading this, unless you don't believe me...) Click the Window's header to create a Window.Loaded event-handler and to navigate to it. Add the following to the eve...

How to get ASP.NET Forms Authentication (using role restrictions) to not redirect to login page.

Does anyone know of a way to get ASP.NET Forms Authentication to not redirect back to the login page if a user is not allowed to visit a certain page or folder based on their role (and perhaps show a message instead)? ...

Why is ASP.net forms authentication logging me off (when not connecting directly on my box)?

I've got an ASP.net 2.0 application on my server at work. When I'm on the box and browsing (either http://serverName or http://localhost) the site I can login with forms authentication and navigate the site with no trouble. The instant I browse that server from my intranet I can still login, but anytime I click any links on the homepag...

Mixing Windows and Forms Authentication in ASP.NET MVC

I'm currently trying to set up a website that uses both windows authentication and forms authentication. I am using ASP.NET MVC and both IIS6 and 7 need to be supported. How would I go about letting known AD users into the app (their AD id is stored against their user record in the application database) and directing everyone else to a...

vb.net .aspxauth

I am working with a large site trying to implement web parts for particular users in a particular subdirectory but I can't get the .ASPXAUTH cookie to be recognized. I've read dozens of tutorials and MS class library pages that tell me how it should work to no avail. I am brand new to Web parts, so I'm sorry if I'm unclear. The idea is ...

two basic Forms authentication issue in ASP.Net

Hello everyone, I am developing on Windows Server 2008 with VSTS 2008 + C# + .Net 3.5 to develop an ASP.Net application using Forms authentication. I am learning Forms authentication from http://msdn.microsoft.com/en-us/library/aa480476.aspx I have two basic questions, I think after call method "FormsAuthentication.SetAuthCookie", th...

Unable to access _layouts from custom login.aspx

I have a custom login.aspx form for SharePoint FBA. However, I want to reference files (images, css etc) in _layouts\me\css etc. each time i try, i get redirected to the login page! How can i get this to work? ...

Create non-persistent cookie with FormsAuthenticationTicket

Hello! I'm having trouble creating a non-persistent cookie using the FormsAuthenticationTicket. I want to store userdata in the ticket, so i can't use FormsAuthentication.SetAuthCookie() or FormsAuthentication.GetAuthCookie() methods. Because of this I need to create the FormsAuthenticationTicket and store it in a HttpCookie. My code l...

Asp.net forms authentication

In my web.config I have this: <system.web> <authentication mode="Forms"> <forms loginUrl="Login.aspx" protection="All" path="/" timeout="30"/> </authentication> <sessionState timeout="20" /> </system.web> <location path="admin"> <system.web> <authorization> <deny users="*"/> <allow us...

Where to store logged user information on ASP.NET MVC using Forms Authentication?

Hello mates, I'm using ASP.NET MVC and Forms Authentication on my application. Basically I use FormsAuthentication.SetAuthCookie to login and FormsAuthentication.SignOut to logout. In the HttpContext.Current.User.Identity I have stored the user name but I need more info about the logged user. I don't want to store my entire User obj in...

MVC - How to store/assign roles of authenticated users

I am upgrading a site to use MVC and am looking for the best way to setup Authenication. At this point i have the login working off of Active Directory, validating a username and password and then setting the auth cookie. My question is how do i store the users role information at time of login in order for my controllers to see those ...

Best way to design authentication in application?

I have design windows application that auto-generate menu items and authentication from database. First time authentication has only one property, so I decide to design to persist authentication in it Tag property. However this property growth to 3 properties, so I want to know is it good to still persist authority in Tag property or cr...

How to elegantly handle ReturnUrl when using UrlRewrite in ASP.NET 2.0 WebForms

I have a folder with multiple .aspx pages that I want to restrict access to. I have added web.config to that folder with <deny users="?"/>. The problem is that ReturnUrl is auto-generated with physical path to the .aspx file while I'm using UrlRewrite. Is there a way to manipulate ReturnUrl without doing manual authentication check a...

How to Anonymously Authenticate between a VB.Net Desktop App and ASP.Net Web App

I'm looking for a way to pass some sort of credentials or Authorization token from a VB.Net Client to an ASP.Net web application that allows the Client to auto-login to our Forms-Authenticated website. If a user is logged into a local application, I want them to be able to view some web pages without having to login to the website as we...

With ASP.NET membership, how can I show a 403?

By default, ASP.NET's membership provider redirects to a loginUrl when a user is not authorized to access a protected page. Is there a way to display a custom 403 error page without redirecting the user? I'd like to avoid sending users to the login page and having the ReturnUrl query string in the address bar. I'm using MVC (and the A...

ASP.NET C#: Getting Started with ASP.NET Authentication

I'm developing my first web portal in ASP.NET where I would like to have authentication. I have heard that ASP.NET has quite a big and well-built authentication system, but I've never used it before. Could you suggest some tutorials or sample code that could help me get started from the basics of ASP.NET authentication? Specifically for...

Forms Authentication and POST requests from AJAX

We have an ASP.NET app protected by forms authentication. The app uses MS AJAX heavily to call its web-services. When the forms authentication times out, and a GET-request happens - all is fine (the user is redirected to a login page). BUT when the forms authentication times out and a POST-request happens (ajax) - no redirect happens, ...