CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.security Tags:
Item Type: NewsGroup Date Entered: 1/8/2007 12:45:41 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 26 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
cb3431
Asp.Net User
Roles.ApplicationName1/8/2007 12:45:41 AM

0/0

I have two role providers on my intranet site. I am trying to create a new user for my public facing web site. My intranet site is using Window authentication and my public facing site is using form authentication. Roles for my intranet are handled by azman and my public site is using sql.

I am trying to add my new user for my public site, but I keep getting the following error.

It works if I change the defaultProvider to my sql provider.

The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

Roles.ApplicationName = "Public"

Roles.AddUserToRole(

"user", "Client_Administrator")

 

Leijun Jie - MS
Asp.Net User
Re: Roles.ApplicationName1/8/2007 9:55:15 AM

0/0

How does the Roles.ApplicationName effect the issue? As I understand Roles.ApplicationName is used to specify which roles are used by RoleManager based particular ApplicationName. Can you post your membership/roleManager providers from web.config?
The future is now...
Sincerely,
LeiJun Jie
Microsoft Online Community Support
cb3431
Asp.Net User
Re: Roles.ApplicationName1/8/2007 12:47:30 PM

0/0

<

roleManager

enabled="true"

cacheRolesInCookie="true"

defaultProvider="IntranetRoles"

cookieName=".ASPXROLES"

cookiePath="/"

cookieTimeout="30"

cookieRequireSSL="true"

cookieSlidingExpiration="true"

createPersistentCookie="false"

cookieProtection="All">

<

providers>

<

clear/>

<

add

name="IntranetRoles"

type="System.Web.Security.AuthorizationStoreRoleProvider"

connectionStringName="AZConnection"

applicationName="WebRoles"/>

<

add

name="SqlRoleProvider"

type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

connectionStringName="csWeb"

applicationName="Web"/>

</

providers>

</

roleManager>

Doesn't applicationName indicate which provider to use?

Leijun Jie - MS
Asp.Net User
Re: Roles.ApplicationName1/9/2007 6:13:28 AM

0/0

No, Roles.ApplicationName doesn't indicate which provider is used by roleManager. As I mentioned in my previous post, Roles.ApplicationName is used to fetch roles from aspnet_Roles with specified ApplicationName. You can execute following query in ASPNET database to get an idea how SQL accociates roles with applications:

select RoleName,ApplicationName
from aspnet_roles r join aspnet_Applications a
on r.ApplicationId=a.ApplicationId

That's similar to Membership.ApplicationName.


The future is now...
Sincerely,
LeiJun Jie
Microsoft Online Community Support
Leijun Jie - MS
Asp.Net User
Re: Roles.ApplicationName1/9/2007 6:25:59 AM

0/0

BTW, your code defines two role providers, and by default the roleManager will always use IntranetRoles provider. If you want to change the provider used by RoleManager, you can take a look at this?MSDN article:

RoleManagerSection Class

The future is now...
Sincerely,
LeiJun Jie
Microsoft Online Community Support
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Programming .NET Components: Design and Build .NET Applications Using Component-Oriented Programming Authors: Juval Lowy, Pages: 624, Published: 2005
Professional DotNetNuke 4: Open Source Web Application Framework for ASP.NET 2.0 Authors: Shaun Walker, Joe Brinkman, Bruce Hopkins, Scott McCulloch, Patrick J. Santry, Chris Paterra, Scott Willhite, Dan Caron, Pages: 517, Published: 2006
Programming WCF Services Authors: Juval Lowy, Pages: 610, Published: 2007
Professional ASP.NET 2.0 Server Control and Component Development Authors: Shahram Khosravi, Pages: 1186, Published: 2006
Professional ASP.NET 2.0 Security, Membership, and Role Management Authors: Stefan Schackow, Pages: 611, Published: 2006
Pro ASP.NET 2.0 in VB 2005: From Professional to Expert Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
System Administration for Oracle E-Business Suite (Personal Edition): Personal Edition Authors: Roel Hogendoorn, LearnWorks.nu, Pages: 188, Published: 2007
Pro ASP.NET 2.0 in C# 2005: Create Next-generation Web Applications with the Latest Version of Microsoft's Revolutionary Technology Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1426, Published: 2006
Microsoft Visual C# 2005 Unleashed Authors: Kevin Hoffman, Pages: 692, Published: 2006
System Administration for Oracle E-Business Suite (Classroom Edition) Authors: Roel Hogendoorn, LearnWorks.nu, Pages: 204, Published: 2007

Web:
Roles.ApplicationName Property (System.Web.Security) Dim value As String value = Roles.ApplicationName Roles. ... The ApplicationName property is used by the Roles class to associate users and roles with ...
Roles.ApplicationName Property (System.Web.Security) Gets or sets the name of the application to store and retrieve role information for.
Roles.ApplicationName - ASP.NET Forums How does the Roles.ApplicationName effect the issue? As I understand Roles. ApplicationName is used to specify which roles are used by ...
CoDe Magazine - Article: Manage Custom Security Credentials the ... CreateRole(string application,string role) { Roles.ApplicationName = application ; Roles. ... ApplicationName = application; return Roles.DeleteRole(role ...
Membership and Role Providers in ASP.NET 2.0 Part II Nov 27, 2005 ... If you have two web applications and need both applications to share the same roles, give both applications the same applicationName and ...
Inside Microsoft: Membership Information and Multiple Applications Clicking btnDisplay will show the current values of Membership.ApplicationName and Roles.ApplicationName. Figure 12 shows how the page will appear with the ...
Licensed to the Apache Software Foundation (ASF) under one * or ... @param applicationName the name of the application this roles belong to * @param roles the .... toArray( roleArray ); return new Roles( applicationName, ...
Code Search: FbRoleProvider2.0.sql from Firebird at Krugle SET SQL DIALECT 3; CREATE TABLE ROLES ( ROLENAME VARCHAR(100) CHARACTER SET UTF8 NOT NULL, APPLICATIONNAME VARCHAR(100) CHARACTER SET UTF8 NOT NULL ) ...
$Id$ * * Copyright 2004 Solarsis Group LLC. * * Licensed under the ... toArray( roleArray ); this.roles = new Roles( applicationName, roleArray ); } /* * * Loads the permission entries extracted from the LDIF. ...
Safari Books Online - 0596102070 - Programming .NET Components ... ValidateUser(userName,password); } public bool IsInRole(string applicationName, string userName,string role) { Roles.ApplicationName = applicationName ...




Search This Site:










theme and remotescript problem

some basic questions, will work for food

dotnetnuke 3.1.1 from behind router

root directory web applications? visual source safe?

strategy for integrating a linux/perl application into a .net 2.0 site

role-based webpart landing page layout with user controls and personalization problems

how re-open a "closed" web part?

cache - working with output cache and sql server cache

unique id for treenode

irc / instant messenger

aspx script code wont execute

placing html tags dinamicaly...

can't load the page in a browser

referencing functions

locale tabel in db

active directory access problem

is it possible to use an uncompiled class?

need help with a bunch of images!

email?

usercontrol referencing another usercontrol

site map error

dnn 2.0.2 b3 - installing skins, [token] processing not working

web deployment projects and web.config file section replacement - does it work?

serialport com1

free issue 10 – skinning toolkit by dnn creative magazine

textbox, events, double click, eventargs?

membership data is not binding

how to make letter with reportviewer

js debugging does not work (vs2008 beta2)

some help with widgets.

 
All Times Are GMT