Asp.net - Custom Role Provider With ActiveDirectory Authentication

Feb 21, 2010

I'm creating a custom Role provider based on the ASP.NET Role provider. I have 3 tables. One for Users, one for Roles, one for UsersInRoles.The Users table has no password column because the users are authenticated with ActiveDirectory. That's my approach so far. I can't get the cusstom Role Provider to work, anyone has the same situation like me. How do you make a custom Role provider works with AD?

View 2 Replies


ADVERTISEMENT

C# - Role-management Provider Using Web.config?

Mar 18, 2011

I'm building a tiny web application with a simple user autentication scheme. I register the users in web.config, like this:

<authentication mode="Forms">
<forms loginUrl="~/login.aspx" defaultUrl="default.aspx" ...>
<credentials passwordFormat="SHA1">

[code].....

View 6 Replies

ASP.NET Membership Check If User Is In A Role In Custom Class

Jan 17, 2010

In my VS solution, I have two projects.One for the Web Interface, other for DataAcess and BusinessLogic. I know I can check if the currently logged-on user is Employee in Web Interface project like this from the code behind:

Dim isEmployee = User.IsInRole("Employee")

The problem is that I have a Class call UserManagement in my the DA and BL project which I want to check the currently logged-on user role also. I can't use Dim isEmployee = User.IsInRole("Employee") because it doesn't have aspx page.

What do I need to do to check the user role in my custom class?

View 2 Replies

.net - Custom Profile Provider Using CMS API?

Feb 11, 2010

I have created a custom Profile Provider that is integrated with the API of a CMS. It works fine when pulling data for an authenticated user (Profile.FirstName), but errors when creating a new user's profile.

[Code]...

View 1 Replies

IDE :: Custom Settings Provider Breaking Designer

Dec 6, 2007

In Visual Studio 2005 or 2008, when adding any User Controls to a Windows Form or other User Control in a Project that implements and is using a custom settings provider, a "Failed to create component" error is displayed. If all references to the custom settings provider are removed from settings.settings and that file is saved then User Controls can be added to Windows Forms and User Controls. However, if the custom settings provider is referenced again in settings.settings, then opening the designer of a Form/Control which includes a User Control results in a "One or more errors encountered while loading the designer..." error message.

I have had a very difficult time in tracking down the root cause of this issue because I assumed it had to do with my code and not the IDE. I am working within the context of a large project which uses User Controls heavily and have written a custom settings provider to persist user settings to a SQL Express database. This settings provider works properly, however if I want to open any Forms or User Controls in designer view I must first manually remove all references to my custom settings provider in setting.settings and then re-add them after the changes are done which is inconvenient to say the least. This problem is not present if the Project is in C#.

View 5 Replies

VS 2008 Using Custom Membership Provider In WinForms?

Feb 8, 2010

I would like to use my custom membership provider (which is working in my asp.netapplication) in my windows forms application.I thought this would be relatively straight forward, and followed these steps:1. Copied MembershipProvider class into my application.2. Add reference to System.Web3. Create app.config with membership settings i.e:

View 3 Replies

Form Authentication Redirect To Custom Page

Feb 20, 2012

I have the folowing code in the login page

If objDR.Read = True Then
Dim ticket As New FormsAuthenticationTicket(1,
objDR("UserID").ToString,

[Code]..

When i login as a student, it cannpt response to redirect the page i want to ,

and login as a lecturer also has the same case, cannot redirect the page i want.

View 5 Replies

Move From Custom Login Screen To Active Directory LDAP Authentication?

Mar 11, 2009

I have a WinForms app with SQL05 backend. It has a standard Login window where users are required to supply a username/password. This is validated using my own code and sprocs. Now one of my big clients has scared the bejezus out of me by saying, "Hey Chris, I want you to change your app in line with all our other IT systems so that users can use their common username and passwords with authentication against LDAP". :confused: Having had a moment to reflect, I have some questions (some very noob in nature!)

1. Is this requirement a big deal? :) Or straightforward to implement?

2. Does this mean that when user's double-click my app icon on the desktop, the authentication automagically happens without the need for a Login screen?

3. How on earth can I test this. My dev environment does not use AD, but I do have SBS2003

4. Can anyone point me to good resources about this on the web?

View 7 Replies

VS 2008 SQL Provider Named Pipes Provider Error 5 Invalid Parameter S Found

Aug 3, 2011

i have 2 computers - a Server and a Client pc which is running on local area network with MICROSOFT SQL SERVER 2008 R2 Developer kit at the main pc and Client computer will need to connect to SQL SERVER at main pc using connection string.Let me named server computer as 'MAGNA-PC' and the client pc as 'LAC-PC' and database name is 'db_referafriend' so the code for MAGNA-PC(server) connection string is:[code] i GOOGLE and YOUTUBE for almost 2 weeks before i post . I know that i need to configure the sql configuration manager and enable tcp/ip also add a new port at firewall to allow remote connection also add the sqlserver.exe and sqlbrowser in firewall and I have also chosen "Using both TCP/IP and named pipes" under Remote Connections in the SQL Server 2005 Surface Area Configuration. and all of this doesnt work!

View 10 Replies

VS 2008 Send E-mail Without Authentication For Servers Without Outgoing Authentication

Mar 28, 2011

as topic, i need to send an e-mail without outgoing authentication becouse server hasn't outgoing authentication.. how i can do this??

View 1 Replies

How To Use ActiveDirectory

Dec 13, 2009

I have an active Directory (window) on the server ..and i want to connect it with my web pages..this is my vb code:

Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Data

[code]....

View 1 Replies

Using Input Box To Return ActiveDirectory Information?

May 20, 2011

I have the following Code so the User can enter their domain before the program runs. The resulting textfile does not output the users..just the word Schema...

EDIT 1: Updated to include all code. I now can run it and it returns a text file that lists

OU=_USERS
OU=_GROUPS
OU=_ETC
ETC ETC

[Code].....

View 2 Replies

Pull Domain Controller Listing From ActiveDirectory?

Jan 8, 2010

How to pull the listing of all the domain controllers from the LDAP server in VB.net 2008. The reason I want to do this is so that I can check each domain controller, one at a time, for the account lockout status of an ID. Right now I use a class with 1 function to pull all of the user properties I need. So far it's pulling from only 1 domain controller.[code]...

View 11 Replies

VS 2008 Convert A SID To User/Group In ActiveDirectory Or LocalMachine?

Jan 21, 2010

We are using Microsoft Authorization Manager (Start -> Run -> AzMan.msc). Anyways one of the store mechanism is to store things in an XML file. I need to write a utility which will analyze the file and show it's finding to the user.It stores many things among which one is the SID of a User/Group or any object from ActiveDirectory or LocalMachine. Now that I got the SID, how do I find what type of object is it and how do I find it's properties?

View 2 Replies

Urgent Add Activedirectory Group To A Local Group?

Apr 6, 2011

anyone have some quick code on how to do this?

wmi is not a option.

View 1 Replies

Asp.net - Add User To A Role When Registering?

Jan 7, 2012

I have a role called "Customer", I wish to add users who register to be to automatically added to that role. At the moment I can only assign users to roles by using ASP.net Web Site Administration Tool.If it helps: I'm using the default login.aspx and register.aspx files from Account folder in vb web profile.

View 1 Replies

Check To See If A Given Username Is In A Certain Role?

Jul 6, 2011

I have an ASP.NET application on our company's intranet. And a funky security requirement.

I need to check to see if a given username is in a certain role. I cannot use

Page.User.IsInRole("MyDomainMyGroup")

because

Page.User.Identity.Name

Returns an empty string. Because of some lovely specifications for this program, I have to keep anonymous access enabled in IIS. Seems to rule out any page.user.identity stuff.

So I did find a way to (at least) get the current user (from System.Environment.UserName), but I need to bounce it against the domain group to see if they're in it. Or, better yet, get a list of users within a given domain so I can check myself. Something like...

Dim UserName as String
UserName = System.Environment.UserName
If User(UserName).IsInRole("MyDomainMyGroup") Then

[Code]....

View 1 Replies

Roles Only Returning 1 Role

Jun 16, 2010

I am having a problem with my roles Identification. I am try to read all the roles for a given user. No matter what I try only the first role, only 1 role for the user is being returned. My code is as follows.

[Code]...

View 3 Replies

Asp.net - Redirecting Based On The User's Role?

Nov 9, 2011

i'm having some problem over here..when user enter their id and password,it will show up the main page and its for user but when admin or staff enter their id,it will enter the user's main page and i have to click admin site on the top hyperlink where it automatically logout and once i enter back admin passwrd or staff passwrd then only it redirect to admin page or staff page.how to make it like once user enter their passwrd it redirect to user page and once admin enter admin password or staff enter their password in the login it redirect to admin or staff ?I have 3 roles over here which are admin,staff and user.Hereby i'll provide you my aspx code and also my vb code which is running behind the program.

[Code]...

View 2 Replies

ASP.NET Redirect User Based On Role?

Jan 23, 2012

I want the app to redirect a user to a different home page depending on their role. Its currently working for 2 users using the following IF?

If Request.IsAuthenticated AndAlso User.IsInRole("Staff") = True Then
Response.Redirect("~/About.aspx")
ElseIf Request.IsAuthenticated AndAlso User.IsInRole("HR") = False Then
Response.Redirect("~/HRHRCompanyNavigation.aspx")
End If

How can I get this to work for more than 2 user roles?

View 1 Replies

ASP.NET Role Manager Feature Has Not Been Enabled

Jul 7, 2011

I'm trying to create a routine in my asp.net's main page that will see if the current user is a member of a Windows domain group. The site is hosted in IIS and is visible through our intranet.

GlenFerrieLive listed this code (which I'd like to use) in an earlier post:
UserName = System.Environment.UserName
If Roles.IsUserInRole(UserName, "MyDomainMyGroup") Then

[Code]....

Problem is, now I'm getting the configuration error 'Default Role Provider could not be found'.

How can I get around this? I just need to see if the current user exists in a specific domain group.

View 2 Replies

SQL Server Application Role Not Working In App

Oct 7, 2009

This desktop app written in VB.Net within VStudio 2008 fails when one of our "power users" tries to run the program: Select permission denied on object 'AcctLogon', database 'MDS', owner 'dbo'. The author of the app is out for a few weeks and I am the "fixer" while she's out. Both of our logins for SQL have permissions for db_owner in the MDS database but our user does not. The user has a Windows user login for this instance of SQL. This login has permissions for the public role only in the MDS database.

[Code]...

View 1 Replies

VB 2008 LINQ To SQL Classes - How To Use App Role

Feb 18, 2010

I am curious as to the proper technique to use SQL Server's AppRole with a LINQ to SQL Class. I understand I have to establish the intial connection with no connection pooling. However, do I simply call the SQL stored procedure sp_setapprole using standard LINQ before executing any of my methods that interact with the database, or is there a better way to enable and use AppRole within the LINQ to SQL class?

View 6 Replies

VS 2008 Using Express Edition In New Job Role?

Mar 6, 2010

Iv'e been away from Visual Basic for the past 3 or 4 years so I am a bit vague on the details that I am looking for.

I got myself my first programming job at the company that I work for and I start Monday.

The company has little programming knowledge (well I assumed this as they said they do not have a dedicated programming IDE at my interview) and relies on ad-hoc VBA scripts to perform necessary processing on data. This is all fine and I can deal with that but there is a project that I wish to work on and I think a standalone dedicated application would be much better than extending Excel with VBA.

Now after being with the company for 10+ years, I know they are conservative at spending money so asking them to buy Visual Studio is not really an option so I'm going to suggest that instead of using VBA, I will design an application using Visual Basic Express.

All I need to know is, if there are any kind of limitation to database accessing with the express editions? (Iv'e only ever used OLEDB connected to small MS Access files) I do not know what type of database the company uses yet, but I do know they use ODBC to connect to it, and rely on Sage to do 90% of their work.

View 5 Replies

Asp.net - Displaying Part Of Commandcolumn Based On Role?

Apr 14, 2012

I have a page with a gridview. The gridview has "Enable Editing" and "Enable Deleting" checked by default. I want to be able to "uncheck" either of these in the code-behind page_load event.

I found this SO question but this hides the whole commandcolumn. I only want to hide the "Edit" or "Delete" hyperlink based on the role of a user. How would I go about doing this?

View 1 Replies

Asp.net - Hide Web Link From Users Without Role Assigned?

Apr 4, 2012

I currently have some security working in my application by using the roles and rules, but i wondered whether it was possible to hide web links depending on if a user belongs to a certain role.I currently have it so users belong to either the 'admin' role or 'user' role. Rules have been setup on folders in my application so if a user belongs to either of the groups they can click on a web link and it takes them to the page. However, if a new user registers they belong to no role, and when they click on the web link it redirects them to the homepage (see code below). This is great, but, i wondered is it possible to hide that web link if the user did not belong to a specific role preventing them click on it. Also if a user belonged to no role could they be redirected to a page to tell them they need a role assigned?

<authentication mode="Forms">
<forms loginUrl="~/Homepage1.aspx" timeout="2880" />
</authentication>

I dont use this in the current application but have in the past, this checks if the user has been authenticated, i wondered whether i could use a similar IF statement for:If user.identity does not belong to 'user' or 'admin' role, then redirect them to page and display error?

If User.Identity.IsAuthenticated = True Then
Dim myUser As MembershipUser
Dim objUser As Object[code].....

View 2 Replies

Asp.net - Retrieve The Currently Logged In User Role Name In Textbox ?

Dec 14, 2010

How to retrieve the currently logged in user role name in textbox using vb.net ? iam currently using

TextBox1.Text = Roles.GetRolesForUser(User.Identity.Name)

om page load event but it is highlighted by a blue line in visual studio 2008

View 1 Replies

Asp.net Mvc - Testing User Role Authorize Attribute In .NET?

Jan 23, 2010

I am using ASP.NET MVC to build a site. I am using VB as programming language.I have couple of questions.

1 I have created a role "Manager". How Do I check if a user belongs to this particular role?

For now I am using If My.User.IsInRole("Manager") Then 'Direct to a view Else 'Direct to another view End If Is this the right way? 2 How to use the Authorize attribute to limit access to a Function?

I know in C# it goes [Authorize (Roles ="Manager")] but not sure in VB. Also can I define property to redirect a user who does not have "Manager" role to a particular view when trying to access this function .

View 1 Replies

C# - ASP.NET Directory Access With Role Based Security?

Apr 27, 2011

I have an ASP.Net portal like application with multiple roles. I have placed the subpages of that role in its own directory adding a web config with an authorization allowing only that role. I have css and javascript in the root directory that can not get access inside the protected role folders. How can I allow these folders css/js to have access to all roles. Sorry if this is easy question I have searched but I am rather new to ASP.NET

View 1 Replies

Disable Nodes In Treeview By User Or Role?

Jun 2, 2011

How to disable node of treeview by user or role in winform

View 10 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved