kadjiokou | Sun, 06 Jan 2008 06:02:00 GMT |
No, im using membership with active directory and with windows authentication. I will use a custom UserProfileInfos.
When i save a security role (in my web application) with the current user, i have to split the identity username and only get the real username but its not working since i have duplicated userProfiles because i still have the domaine name which i dont wont to have in my web app.
thank you for your time
beaulieu | Sun, 06 Jan 2008 06:03:00 GMT |
If you are using the ActiveDirectoryMembershipProvider, the you can add theattributeMapUsernam="sAMAccountName" to your provider definition in web.config.
This seems to work for me.
Thanks
/kadji
kadjiokou | Sun, 06 Jan 2008 06:04:00 GMT |
I have that attribute yes, but im still having this format saved in the user profile and roles like this... "domaineName\Username"
as i said, im trying to work with the username only when it saved in the DataBase.
thanks for your help.
beaulieu | Sun, 06 Jan 2008 06:05:00 GMT |
kadjiokou | Sun, 06 Jan 2008 06:06:00 GMT |
Here my web.config.
<configuration><configSections><sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"><sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"><section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/><sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"><section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/><section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/><section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup></sectionGroup></sectionGroup><section name="magicAjax" type="MagicAjax.Configuration.MagicAjaxSectionHandler, MagicAjax"/><section name="WebConfigs" type="Abitibi.Components.WebConfigSection"/></configSections><WebConfigs defaultConnectionStringName="LocalSqlServer"><HL/></WebConfigs><connectionStrings><clear/><add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Initial Catalog=Abitibi;Integrated Security=True" providerName="System.Data.SqlClient"/><add name="ADServices" connectionString="LDAP://AMER.PFIZER.COM"/></connectionStrings><magicAjax tracing="false"><pageStore/></magicAjax><system.web><pages theme="Default"><controls><add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add tagPrefix="NickLee" namespace="NickLee.Web.UI" assembly="NickLee.Web.UI"/><add tagPrefix="ajax" namespace="MagicAjax.UI.Controls" assembly="MagicAjax"/> <add tagPrefix="ComponentArt" namespace="ComponentArt.Web.UI" assembly="ComponentArt.Web.UI"/></controls></pages><membership defaultProvider="WindowsMembership"><providers><clear/><add name="WindowsMembership" enableSearchMethods="true" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ADServices" attributeMapUsername="sAMAccountName" attributeMapEmail="mail"/></providers></membership><profile enabled="true" defaultProvider="SqlProfile" inherits="Abitibi.Providers.WebUserProfileInfo, Abitibi"><providers><clear/><add name="SqlProfile" type="System.Web.Profile.SqlProfileProvider" connectionStringName="LocalSqlServer"/></providers></profile><identity impersonate="true"/><roleManager enabled="true" defaultProvider="SqlRoleProvider"><providers><clear/><add name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="LocalSqlServer"/></providers></roleManager><!--<globalization culture="fr-CA" />--> <globalization culture="en-CA" uiCulture="en-CA" /><authentication mode="Windows"/><compilation debug="true"><assemblies><add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/><add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/><add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/><add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/><add assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/><add assembly="Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/><add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies><buildProviders><add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/></buildProviders></compilation><httpHandlers><remove path="*.asmx" verb="*"/><add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/><add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/><add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/><add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/></httpHandlers><httpModules><add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add name="MagicAjaxModule" type="MagicAjax.MagicAjaxModule, MagicAjax"/></httpModules></system.web><system.webServer><validation validateIntegratedModeConfiguration="false"/><modules><add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></modules><handlers><remove name="WebServiceHandlerFactory-Integrated"/><add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></handlers></system.webServer></configuration>
beaulieu | Sun, 06 Jan 2008 06:07:00 GMT |
Hello allI am trying to capture the login ID (lan id) of the user. I have found the code in order to capture it on the server where the forms resides, however I need to capture the info on the user computer.Current code:identity.text = System.Security.Principal.WindowsIdentity.GetCurrent().Name...
I know this is a subject coming up at lot but I still seem to missing something!!Im running a SQL server on a 2k server box and developing an ASP.Net app on a win 2k box running iis locally and connecting to the SQL Server. The website is configured for Windows authentication and am using the we...
Hello,I have some images on my site that are saved in the website directory.The url is something like: viewimage.aspx?id=1234&code=sdfThe problem is that it cannot find the image. (unable to read directory)<identity impersonate="false"/But when I set this line to true it works.<identity im...
Hi everyone,I am trying to flow an Identity authenticated with "Forms Authentication" through Remoting Layers.I built a Windows Service to host my Remoting Business Components and deployed this on a server A. Also, I made an asp.net website that consumes these Remoting components and deployed on...
When using the PasswordRecovery control I've got the message: "Your answer could not be verified. Please try again." when typing the "Security Answer". I've double checked my configuration and made some changes to see if it's a decryption problem. I've read some post similar...
I dont understand what is going on I must be missing something. Once ia a while the identityName returns "" even if User.Identity.IsAuthenticated return true. Why is the identityName getting lost and what can I do in order to avoid this?Thanks<code> Case "Add" 'Make...
What is the difference between SiteIdentity, SitePrincipal vs membership providers? Which one should I prefer for my asp.net 2.0 application.1. Do I use my own custom membership provider2. Do I use my custom siteidentity and principal and create a pagebase class with all the other aspx pages inh...
Hi all,Iam having a problem with User.Identity.Name in my C# application.First Iam reading username in to a string, and then using that to pull the record from SQL database. When I do Response.Write, its just blank. I am using windows authentication. I also checked web.config to make sure that,&...
I'm having a problem running some code which works fine on my local machine but not on my shared web hosting.Hopefully someone can offer a suggestion or solution!I am using role base security in my application so when a user is successfully authenticatedIPrinciple and IIdentity implementati...
Hi, I've developped an application using asp.net which uses users' authentication through Active Directory. When I deploy the application on a server using Windows 2000 (Sp3) with Active Directory , it works, but after installing SP4, I get the message below (in the authenticating page...
I am running an ASP.NET application using .NET Framework 1.1 and need to set the identity impersonate to true and use the SYSTEM username in the web.config file as in:<identityimpersonate="true"userName="SYSTEM"password="AutoGenerate"/>Doing this results in the configuration error:Could n...
Hello!I have a WebApp running wich is secured by a VeriSign SSL certificate. The WebApp is accessable only through SSL and can be viewed by anyone. I have to add some members-only pages wich will be available only to some agencies. I thought there is some SW wich can generate certificate pairs,...
Hello,In asp.net 2.0 using the configuration I have created three user groups, i.e. (standard, supervisor, administrator)How can I find out if a logged in user is a member of one of these groups so that the appropriate control is shown or hidden?For example: Alex signs in. He is a member of the...
iam currently developing a banking application in that this is one of sequrity thing thai is when any customer is ideal for 5 minutes in a logined page than that page automatically logoutplz give the idea how to impliment it (with or with out sample code)...
Anyone have a good example of using windows for authenication and rolls in membership? I've looked all over and most seem to be for outside facing web where the membership has nothing to do with active directory....