forms-authentication

Switch from old ASP.NET Membership to ASP.NET identity (Visual Studio 2013)

三世轮回 提交于 2019-12-09 09:30:48
问题 Introducing ASP.NET Identity – A membership system for ASP.NET applications http://blogs.msdn.com/b/webdev/archive/2013/06/27/introducing-asp-net-identity-membership-system-for-asp-net-applications.aspx Now when creating a new web application with ASP.NET 4.5, we have the new "ASP.NET Identity". I manage to let my application to use my MSSQL database with the build in register/login/change password functions, but I am not sure how to do other operation like old days ( especially the "ASP.NET

what's differences between “forms timeout”, “membership userIsOnlineTimeWindow” and “sessionState timeout”

泪湿孤枕 提交于 2019-12-09 09:25:24
问题 What is the difference between these lines of code: <forms timeout="5" /> <membership userIsOnlineTimeWindow="5" /> <sessionState timeout="5" /> Thanks a lot. 回答1: Forms (FormsAuthention) are used for authentication and when it times out it will logout user. You can 'prevent' timeout by setting SlidingExpiration property to 'true' and it will renew forms ticket on user activity (read request to asp) if needed. This will keep user logged on while he is 'active' on your site. Membership is used

forms authentication with sql server 2008 database questions

╄→尐↘猪︶ㄣ 提交于 2019-12-09 03:38:55
问题 Hello I been trying to figure out how to set up ASP.Net forms authentication with sql database I have been trying to figure out how to set up my forms authentication with my sql database. So when I update my admin table it also updates the admin list in the forms authentication. Any ideas would help thank you! 回答1: Just run the aspnet_regsql.exe tool and the membership database will be created for you. If you run it without any parameters, it will present you with a wizard to guide you

Setting up FormsAuthentication after SSO authentication

流过昼夜 提交于 2019-12-09 02:06:12
问题 My ASP.NET MVC 4 application is protected by SSO (OAM) with an ISAPI filter running on IIS. When a request to my application is received, it is intercepted by ISAPI filter and redirected to SSO. User has to login at SSO and after that he is returned to my application. The username of authenticated user (via SSO) is shared with my application in HTTP Request Headers. Request.Headers["username"] What I am trying to achieve is - after SSO authentication, setting FormsAuthentication within my

How to get at contents of Forms Authentication ticket with PHP

☆樱花仙子☆ 提交于 2019-12-09 01:43:59
问题 I need to undo the following ASP.Net processes in PHP so I can get at the username and expiration date in a ticket. I've decrypted the 3DES encryption (step 3 below) but I'm not sure what I need to do next. Is the string that results from decryption a byte array? Should I be able to convert it to ascii? (Because it doesn't). What ASP.Net does to create ticket: Serialize username, expiration, other data (which I don't care about). Create a byte array. Sign the ticket using SHA1 (the sig is the

User.Identity.IsAuthenticated always false after PasswordSignInAsync gives success

落花浮王杯 提交于 2019-12-08 16:56:49
问题 I've got a standard MVC project, with the UserManager and SignInManager objects and an AccountController, with the pre-created login and register type functionality. I can register new users to my AspNetUsers table, but when I login I call:- var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false); The data is coming through from the form correctly, and the result is Success, which I expected. I then tried the following

How can I pass logged on user details from ASP.Net web app to WCF service?

怎甘沉沦 提交于 2019-12-08 16:16:32
I have 2 web applications: one is an ASP.Net web app and the other is an ASP.Net WCF web services application. I want to the web app to the WFC web app's consume services. Eventually, these 2 apps will be communicating over a firewall. I want the user to log on to the client web app using forms authentication, authenticated by the wcf service, and then to be able to access service resources based on his roles. So far I have managed to log on using System.Web.ApplicationServices.AuthenticationService although I haven't been able to get the IsLoggedIn service method to return true. However, the

Does FormsAuthentication.SetAuthCookie() Require a Redirect?

孤者浪人 提交于 2019-12-08 16:08:18
问题 After checking a user's credentials and confirming they are good, I'm using FormsAuthentication.SetAuthCookie("Username", false); to authenticate the user. In the masterpage I then use Page.User.Identity.IsAuthenticated to make sure we're dealing with a logged in user and not a guest. The problem lies in first setting the auth cookie. When I set the auth cookie, immediately afterwards I run a method that uses Page.User.Identity.IsAuthenticated to change the welcome message from a generic

FormsAuthentication Membership.GetUser() Null

╄→尐↘猪︶ㄣ 提交于 2019-12-08 15:56:22
问题 I am using Forms Authentication and have the basic logon page and default page. When I am on the logon page, and call the SignOn this works just great. However, when I am still on the Logon page the Membership.GetUser() returns null. When I redirect to my default page, the Membership.GetUser() returns my user information. Is there any way I get get this method to return my user while still on the logon page. I have read all over google that other have similar issues where it will only work

Forms Authentication User.IsInRole() randomly not working in LogOn

孤者浪人 提交于 2019-12-08 15:27:31
问题 I was changing the default LogOn function in an MVC3 project to redirect a user to a certain page based on their role by using User.IsInRole() . When I was testing this out, the first couple users redirected as expected, but after that I had a couple that didn't redirect to where they are supposed to (they passed through all the statements and hit the default home index.) It seems completely random, sometimes my admin will be taken to the admin page, other times not. My LogOn function: