Questions tagged as 'forms-authentication'

1
answer

Asp.Net MVC authentication using FormsAuthentication

I'm implementing authentication in my ASP.NET MVC application. I am using FormsAuthentication for this authentication of each user and for each logged in user 5 sessions are assigned (Name, CodSetor, FolderPad, Status and CodPerfil). Au...
asked by 03.07.2016 / 15:56
3
answers

Authorization of users to actions that use the Authorize attribute

I put [Authorize] in my controllers and entered this code: <authentication mode="Forms"> <forms loginUrl="/Login/Login" /> </authentication>' For every time code 401 occurs it redirects to the login page, but I...
asked by 18.11.2015 / 17:20
1
answer

Unique authentication for multiple projects using Entity Framework

Currently in my solution I have several ASP.NET web projects, each with the default default authentication code of the MVC entity framework (there are small customizations in entities only). The projects share the same entities and the same data...
asked by 19.04.2017 / 18:19
1
answer

How to redirect the user to a specified page after login

I am able to login by user type: admin or common. And I'm using:    [Authorize (Roles="Administrator")] and   [Authorize (Roles="Common")] Within the Controllers I want to restrict by type of user that can access it. But I would like to m...
asked by 21.10.2018 / 02:22
1
answer

FormsAuthentication causes an infinite redirect error - ASP.NET C #

Good afternoon, I'm developing an ASP.NET application with C # that requires login, works and is being used this way: protected void Page_Load(object sender, EventArgs e) { SqlConnection conn = new SqlConnection(...
asked by 14.04.2016 / 17:00
2
answers

How do I disable Forms Authenitcation for the Web API?

I have an Asp.Net MVC project and inside it has the Api web, when a request sends an invalid token, the forms authentication redirects to the login page, but I need it to only return an Http 401 error as it is an Api Rest. I already tried to use...
asked by 03.02.2017 / 17:24
1
answer

ASP.NET MVC Default Page

Personally I have an ASP.NET MVC application with FormsAutentication and I'm having a hard time leaving a controller as the home page. I already released it in web.config , but it still does not work. The controller is called a...
asked by 15.07.2016 / 19:34
0
answers

FormsAuthentication - How to not expire session

I've been searching some way that my session will never expire, unless the user logs out. My code is like this, I am obliged to inform the validity of the session: public void CreateAuthorizeTicket(string userId, string roles) { var auth...
asked by 05.12.2018 / 16:51
1
answer

Use Forms Authentication in an ASP.NET Core application

I'm migrating an ASP.NET Web site (.NET Framework 4.7) to ASP.NET Core (but still using .NET 4.7 as a "target framework" ) - The goal is to use Razor Pages, dependency injection, and other resources present in Core while maintaining more "tra...
asked by 25.08.2018 / 00:30
0
answers

Forms Authentication redirect to another login application and return to authenticated application

Good afternoon, folks, I want to do the following with Forms Authentication: 1 - When accessing application link the user is not authenticated the application redirects to the application link : loginUrl="http: // localhost: 51040 /"...
asked by 09.05.2018 / 21:01