asp.net-membership

How do I get a list of roles for the currently logged in user.

I want to know what roles a logged in user belongs to without having to check the user against all possible roles (i.e. using Page.User.IsInRole()) ...

Invalidate another users session variables

I'm thinking of a situation where an administrator makes some changes to another user in the system that happens to be logged in. Is there any programatic way to invalidate that specific users session variables and force them to be repopulated? Use Case Admin Edits Bobs preferences Business Logic clears bobs preferences stored in ses...

Update ASP.Net membership from windows service

I am working on a project for a property management company. There is the back end system that stores all of the tenants and property portfolios, and a front end website that allows users to view their packages, service requests etc. I need to write a windows service that pulls their information out of the back end and place it into th...

user creation event for ASP.NET or DotNetNuke membership

I want to add some code that runs when a new user is registered on a DotNetNuke site. There is a custom registration module, and I could add code to that. My concern is this registration module is still a work in progress thats not really in my control. Someone could break the code I add or do something unexpected. Is there another g...

Using built in ASP.NET membership to secure web services.

Is it possible to use the built in ASP.NET membership provider to secure a web service? I have a SQL Server database already setup with my membership and now I want to provide a web service that only members are allowed to use. Is it possible to authenticate against this (if so how?) or do I need to have a seperate type of authenticatio...

Is possible to use System.Web.Security.Membership.GetAllUsers() with some LinqDataSource control?

I want to use that and to be able to sort and edit records inside a gridview. Is possible? How? Thanks! ...

When developing a web app (ASP.NET/MVC) when do you add your security?

When developing a web app, in my case a ASP.NET MVC app, but this question isn't platform specific, when you do you add the infrastructure for membership, roles and authentication? I've actually done it both ways.... 1. Start developing the app with membership/roles/authentication being one of the first milestones and 2. Wait until mos...

How can I get CURRENT USERNAME in membership asp.net 2008

Hello, I use a membership in asp.net 2008. And I build a login system with some rolls ...etc I have a database and tables and the KEY is "username", and now I want to know how can I get a username for the member who logged in ? for example: I logged in as TURKI I want to get the username TURKI really I need for help... thanks, ...

Asp.Net Membership and Roles with Different Application Names

I ran into an interesting glitch (at least a glitch on my part) yesterday when an application I was testing had a different application name specified for the membership and role provider (membership was one, role was diferent one). I'm wondering if anyone knows of a resource that give me more information on the scenario. I then ran a ...

Explicitly changing a connection string for MembershipProvider

I am using the following provider to look up users from ADAM. I would be able to like to change the connection string dynamically depending on the type of user. How can I achiev this? <add name="con1" connectionString="LDAP://con1.url" /> <add name="con2" connectionString="LDAP://con2.url" /> <providers> <add name="Connec...

ASP.NET membership get UserId of anonymous user

I have an existing project that i'm working on that uses .net membership. We want to expand the project to allow anonymous users but we seem to have hit a snag as we use the UserId of the aspnet_Users table as a foreign key in many of our database tables. The following call returns null as there is no record in the aspnet_Membership ta...

How can i implement a role-hierarchy in an asp.net mvc app using activedirectorymembershipprovider

In my asp.net mvc app i am using the activedirectorymembershipprovider. In the active directory i have created a couple of roles (groups) similar to, for simplicity of this example, "normal" and "administrator". I am currently querying whether user is in role by getting the IPrincipal of the httpcontext and calling User.IsInRole(nameOfR...

How to test asp.net membership, profile, roles with VS Test Framework?

Hey all, We're getting some errors, if we try to test something with the asp.net membership framework. It seems that it can't instantiate the asp.net membership environment and so, it can't access all the profiles, users and so on. Has anybody seen a similar problem? Or is it working for someone? Cheers, Steve ...

Which authentication and authorization schemes are you using - and why?

We're beginning to design a whole bunch of new services to create (WCF, ADO.NET Data Services, possibly in the cloud at some point) and one question that pops up is what authentication and authorization scheme to use - there are quite a few! We basically need to be able to identify users (actual people, and "virtual" application/servic...

Adding custom membership to forms

I have a site that uses the asp.net membership tables (ASP 3.5 site). I am going to use an excel sheet to periodically add users to the membership tables and I want to upload all the excel information via a form. I used a little form app to process the excel sheet and am now ready to add the information to the membership tables. Is t...

Storing Account / Passwords

I am working on a web based application that will need to store usernames and passwords. Account information will be needed to perform secondary authentication on behalf of users so I can't simply store usernames and passwords using one-way hashing with salt etc. Assuming that my basic requirement can't change, any suggestions on how to...

How to connect to DB on SERVER for Asp.Net membership?

I've just upload my ASPNETDB.mdf using "Generate Scripts" into server. The problem is, I don't know how can I connect to it for my Membership.(e.g LogIn Controls) where is the ConnectionString? ...

Normalization of Strings With String.ToUpperInvariant()

I am currently storing normalized versions of strings in my SQL Server database in lower case. For example, in my Users table, I have a UserName and a LoweredUserName field. Depending on the context, I either use T-SQL's LOWER() function or C#'s String.ToLower() method to generate the lower case version of the user name to fill the Low...

ASP.Net membership validating users created manually

I am manually creating users in my asp.net user tables with the membership.creatuser(). Is there an easy way to test to make sure the account is created and or valid after I create it? MembershipCreateStatus status = new MembershipCreateStatus(); Membership.CreateUser(user.FirstName + user.LastName, user.Passw...

Authorization problem, FormsAuth and ASP.NET MVC

I have a pretty simple ASP.NET MVC Site Application. (MVC 1.0) I have NO authorization sections in my web.config because I use the [Authoize] attribute on my controllers. The default web.config for the server allows * for forms authentication, as expected. I have 2 existing Windows 2008 dedicated (hosted) servers. The site works well...