Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > asp.net 2.0 roles not working when deploying to web server

Reply
Thread Tools

asp.net 2.0 roles not working when deploying to web server

 
 
Homer
Guest
Posts: n/a
 
      07-19-2007
Hi,

I'm developing my first ever web application and I'm running into a
lot of problems. My problem I'm encountering now is how to make roles
work when I deploy my web app to my company's server. It's an
Intranet application. I used forms authentication and I enabled the
role manager in the web.config file. I created a folder in the
application root directory and put all the web pages that require
authentication in there. Then I created a web.config file for that
folder like the following:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<authorization>
<deny users="*" />
</authorization>
</system.web>
<location path="HRSearch.aspx">
<system.web>
<authorization>
<allow roles="HumanResourceMember"/>
</authorization>
</system.web>
</location>
<location path="YourInformation.aspx">
<system.web>
<authorization>
<allow roles="User, HumanResourceMember"/>
</authorization>
</system.web>
</location>
</configuration>

the next thing I did was adding roles into the site.sitemap file like
the following:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"
>

<siteMapNode url="Default.aspx"
title="Home"
description="Home page">
<siteMapNode title="Personnel Information" roles="*" >
<siteMapNode url="PersonnelInformation/HRSearch.aspx"
title="Personnel Search"
description="This option is only available to HR
staff"
roles="HumanResourceMember" />
<siteMapNode url="PersonnelInformation/YourInformation.aspx"
title="Your Information"
description="Your personal information"
roles="User,HumanResourceMember"/>
</siteMapNode

The roles implementation works on my development machine but when I
deployed the application to my company's IIS server it does not work.
When I login in as a member of the user role, I expect to see the
"Your Information" page. When I login as a member of the
HumanResourceMember, I expect to see the "Personnel Search" page. It
works wonderfully on my XP development machine but neither of the
aforementioned pages show up when I login to it remotely. I don't
even know how to google this problem. Please help me.

Thank you,
Jon

 
Reply With Quote
 
 
 
 
clintonG
Guest
Posts: n/a
 
      07-20-2007
Start by reading another news article posted earlier today: "Membership
database problems."

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/




"Homer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hi,
>
> I'm developing my first ever web application and I'm running into a
> lot of problems. My problem I'm encountering now is how to make roles
> work when I deploy my web app to my company's server. It's an
> Intranet application. I used forms authentication and I enabled the
> role manager in the web.config file. I created a folder in the
> application root directory and put all the web pages that require
> authentication in there. Then I created a web.config file for that
> folder like the following:
>
> <?xml version="1.0" encoding="utf-8"?>
> <configuration>
> <system.web>
> <authorization>
> <deny users="*" />
> </authorization>
> </system.web>
> <location path="HRSearch.aspx">
> <system.web>
> <authorization>
> <allow roles="HumanResourceMember"/>
> </authorization>
> </system.web>
> </location>
> <location path="YourInformation.aspx">
> <system.web>
> <authorization>
> <allow roles="User, HumanResourceMember"/>
> </authorization>
> </system.web>
> </location>
> </configuration>
>
> the next thing I did was adding roles into the site.sitemap file like
> the following:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"
>>

> <siteMapNode url="Default.aspx"
> title="Home"
> description="Home page">
> <siteMapNode title="Personnel Information" roles="*" >
> <siteMapNode url="PersonnelInformation/HRSearch.aspx"
> title="Personnel Search"
> description="This option is only available to HR
> staff"
> roles="HumanResourceMember" />
> <siteMapNode url="PersonnelInformation/YourInformation.aspx"
> title="Your Information"
> description="Your personal information"
> roles="User,HumanResourceMember"/>
> </siteMapNode
>
> The roles implementation works on my development machine but when I
> deployed the application to my company's IIS server it does not work.
> When I login in as a member of the user role, I expect to see the
> "Your Information" page. When I login as a member of the
> HumanResourceMember, I expect to see the "Personnel Search" page. It
> works wonderfully on my XP development machine but neither of the
> aforementioned pages show up when I login to it remotely. I don't
> even know how to google this problem. Please help me.
>
> Thank you,
> Jon
>



 
Reply With Quote
 
 
 
 
Homer
Guest
Posts: n/a
 
      07-20-2007
On Jul 19, 5:02 pm, "clintonG" <(E-Mail Removed)> wrote:
> Start by reading another news article posted earlier today: "Membership
> database problems."
>
> <%= Clinton Gallagher
> NET csgallagher AT metromilwaukee.com
> URLhttp://clintongallagher.metromilwaukee.com/
>
> "Homer" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed) oups.com...
>
>
>
> > Hi,

>
> > I'm developing my first ever web application and I'm running into a
> > lot of problems. My problem I'm encountering now is how to make roles
> > work when I deploy my web app to my company's server. It's an
> > Intranet application. I used forms authentication and I enabled the
> > role manager in the web.config file. I created a folder in the
> > application root directory and put all the web pages that require
> > authentication in there. Then I created a web.config file for that
> > folder like the following:

>
> > <?xml version="1.0" encoding="utf-8"?>
> > <configuration>
> > <system.web>
> > <authorization>
> > <deny users="*" />
> > </authorization>
> > </system.web>
> > <location path="HRSearch.aspx">
> > <system.web>
> > <authorization>
> > <allow roles="HumanResourceMember"/>
> > </authorization>
> > </system.web>
> > </location>
> > <location path="YourInformation.aspx">
> > <system.web>
> > <authorization>
> > <allow roles="User, HumanResourceMember"/>
> > </authorization>
> > </system.web>
> > </location>
> > </configuration>

>
> > the next thing I did was adding roles into the site.sitemap file like
> > the following:

>
> > <?xml version="1.0" encoding="utf-8" ?>
> > <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"

>
> > <siteMapNode url="Default.aspx"
> > title="Home"
> > description="Home page">
> > <siteMapNode title="Personnel Information" roles="*" >
> > <siteMapNode url="PersonnelInformation/HRSearch.aspx"
> > title="Personnel Search"
> > description="This option is only available to HR
> > staff"
> > roles="HumanResourceMember" />
> > <siteMapNode url="PersonnelInformation/YourInformation.aspx"
> > title="Your Information"
> > description="Your personal information"
> > roles="User,HumanResourceMember"/>
> > </siteMapNode

>
> > The roles implementation works on my development machine but when I
> > deployed the application to my company's IIS server it does not work.
> > When I login in as a member of the user role, I expect to see the
> > "Your Information" page. When I login as a member of the
> > HumanResourceMember, I expect to see the "Personnel Search" page. It
> > works wonderfully on my XP development machine but neither of the
> > aforementioned pages show up when I login to it remotely. I don't
> > even know how to google this problem. Please help me.

>
> > Thank you,
> > Jon- Hide quoted text -

>
> - Show quoted text -


Hi Clinton,

The link you provided is not valid. I did a search on membership
database problems but did not find anything applicable to my problem.
I use the aspnet_sql tool to integrate the membership database with my
existing database and I override the pointer in the web.config file as
follows:

<membership defaultProvider="CustomizedProvider">
<providers>
<add name="CustomizedProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="csEmployeeSelfService"
applicationName="EOIntranet"/>
</providers>
</membership>

<roleManager enabled="true"
defaultProvider="CustomizedRoleProvider">
<providers>
<add name="CustomizedRoleProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="csEmployeeSelfService"/>
</providers>
</roleManager>

Please advise. Thanks.

 
Reply With Quote
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      07-20-2007
Did you actually put the roles in the live database or did you only use the
web.config tool on your local database? If you did not actually migrate the
roles, there is your problem.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
"Homer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hi,
>
> I'm developing my first ever web application and I'm running into a
> lot of problems. My problem I'm encountering now is how to make roles
> work when I deploy my web app to my company's server. It's an
> Intranet application. I used forms authentication and I enabled the
> role manager in the web.config file. I created a folder in the
> application root directory and put all the web pages that require
> authentication in there. Then I created a web.config file for that
> folder like the following:
>
> <?xml version="1.0" encoding="utf-8"?>
> <configuration>
> <system.web>
> <authorization>
> <deny users="*" />
> </authorization>
> </system.web>
> <location path="HRSearch.aspx">
> <system.web>
> <authorization>
> <allow roles="HumanResourceMember"/>
> </authorization>
> </system.web>
> </location>
> <location path="YourInformation.aspx">
> <system.web>
> <authorization>
> <allow roles="User, HumanResourceMember"/>
> </authorization>
> </system.web>
> </location>
> </configuration>
>
> the next thing I did was adding roles into the site.sitemap file like
> the following:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"
>>

> <siteMapNode url="Default.aspx"
> title="Home"
> description="Home page">
> <siteMapNode title="Personnel Information" roles="*" >
> <siteMapNode url="PersonnelInformation/HRSearch.aspx"
> title="Personnel Search"
> description="This option is only available to HR
> staff"
> roles="HumanResourceMember" />
> <siteMapNode url="PersonnelInformation/YourInformation.aspx"
> title="Your Information"
> description="Your personal information"
> roles="User,HumanResourceMember"/>
> </siteMapNode
>
> The roles implementation works on my development machine but when I
> deployed the application to my company's IIS server it does not work.
> When I login in as a member of the user role, I expect to see the
> "Your Information" page. When I login as a member of the
> HumanResourceMember, I expect to see the "Personnel Search" page. It
> works wonderfully on my XP development machine but neither of the
> aforementioned pages show up when I login to it remotely. I don't
> even know how to google this problem. Please help me.
>
> Thank you,
> Jon
>



 
Reply With Quote
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      07-20-2007
One more idea. You did actually put an application name for the application
(in the providers portion of the web.config file)?
http://weblogs.asp.net:80/scottgu/ar...Providers.aspx

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
"Cowboy (Gregory A. Beamer)" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Did you actually put the roles in the live database or did you only use
> the web.config tool on your local database? If you did not actually
> migrate the roles, there is your problem.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> http://gregorybeamer.spaces.live.com
> Co-author: Microsoft Expression Web Bible (upcoming)
>
> ************************************************
> Think outside the box!
> ************************************************
> "Homer" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
>> Hi,
>>
>> I'm developing my first ever web application and I'm running into a
>> lot of problems. My problem I'm encountering now is how to make roles
>> work when I deploy my web app to my company's server. It's an
>> Intranet application. I used forms authentication and I enabled the
>> role manager in the web.config file. I created a folder in the
>> application root directory and put all the web pages that require
>> authentication in there. Then I created a web.config file for that
>> folder like the following:
>>
>> <?xml version="1.0" encoding="utf-8"?>
>> <configuration>
>> <system.web>
>> <authorization>
>> <deny users="*" />
>> </authorization>
>> </system.web>
>> <location path="HRSearch.aspx">
>> <system.web>
>> <authorization>
>> <allow roles="HumanResourceMember"/>
>> </authorization>
>> </system.web>
>> </location>
>> <location path="YourInformation.aspx">
>> <system.web>
>> <authorization>
>> <allow roles="User, HumanResourceMember"/>
>> </authorization>
>> </system.web>
>> </location>
>> </configuration>
>>
>> the next thing I did was adding roles into the site.sitemap file like
>> the following:
>>
>> <?xml version="1.0" encoding="utf-8" ?>
>> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"
>>>

>> <siteMapNode url="Default.aspx"
>> title="Home"
>> description="Home page">
>> <siteMapNode title="Personnel Information" roles="*" >
>> <siteMapNode url="PersonnelInformation/HRSearch.aspx"
>> title="Personnel Search"
>> description="This option is only available to HR
>> staff"
>> roles="HumanResourceMember" />
>> <siteMapNode url="PersonnelInformation/YourInformation.aspx"
>> title="Your Information"
>> description="Your personal information"
>> roles="User,HumanResourceMember"/>
>> </siteMapNode
>>
>> The roles implementation works on my development machine but when I
>> deployed the application to my company's IIS server it does not work.
>> When I login in as a member of the user role, I expect to see the
>> "Your Information" page. When I login as a member of the
>> HumanResourceMember, I expect to see the "Personnel Search" page. It
>> works wonderfully on my XP development machine but neither of the
>> aforementioned pages show up when I login to it remotely. I don't
>> even know how to google this problem. Please help me.
>>
>> Thank you,
>> Jon
>>

>
>



 
Reply With Quote
 
Homer
Guest
Posts: n/a
 
      07-20-2007
On Jul 19, 7:18 pm, "Cowboy \(Gregory A. Beamer\)"
<(E-Mail Removed)> wrote:
> One more idea. You did actually put an application name for the application
> (in the providers portion of the web.config file)?http://weblogs.asp.net:80/scottgu/ar...ways-set-the-_...
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBAhttp://gregorybeamer.spaces.live.com
> Co-author: Microsoft Expression Web Bible (upcoming)
>
> ************************************************
> Think outside the box!
> ************************************************
> "Cowboy (Gregory A. Beamer)" <(E-Mail Removed)> wrote in
> messagenews:(E-Mail Removed). ..
>
>
>
> > Did you actually put the roles in the live database or did you only use
> > the web.config tool on your local database? If you did not actually
> > migrate the roles, there is your problem.

>
> > --
> > Gregory A. Beamer
> > MVP; MCP: +I, SE, SD, DBA
> >http://gregorybeamer.spaces.live.com
> > Co-author: Microsoft Expression Web Bible (upcoming)

>
> > ************************************************
> > Think outside the box!
> > ************************************************
> > "Homer" <(E-Mail Removed)> wrote in message
> >news:(E-Mail Removed) roups.com...
> >> Hi,

>
> >> I'm developing my first ever web application and I'm running into a
> >> lot of problems. My problem I'm encountering now is how to make roles
> >> work when I deploy my web app to my company's server. It's an
> >> Intranet application. I used forms authentication and I enabled the
> >> role manager in the web.config file. I created a folder in the
> >> application root directory and put all the web pages that require
> >> authentication in there. Then I created a web.config file for that
> >> folder like the following:

>
> >> <?xml version="1.0" encoding="utf-8"?>
> >> <configuration>
> >> <system.web>
> >> <authorization>
> >> <deny users="*" />
> >> </authorization>
> >> </system.web>
> >> <location path="HRSearch.aspx">
> >> <system.web>
> >> <authorization>
> >> <allow roles="HumanResourceMember"/>
> >> </authorization>
> >> </system.web>
> >> </location>
> >> <location path="YourInformation.aspx">
> >> <system.web>
> >> <authorization>
> >> <allow roles="User, HumanResourceMember"/>
> >> </authorization>
> >> </system.web>
> >> </location>
> >> </configuration>

>
> >> the next thing I did was adding roles into the site.sitemap file like
> >> the following:

>
> >> <?xml version="1.0" encoding="utf-8" ?>
> >> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"

>
> >> <siteMapNode url="Default.aspx"
> >> title="Home"
> >> description="Home page">
> >> <siteMapNode title="Personnel Information" roles="*" >
> >> <siteMapNode url="PersonnelInformation/HRSearch.aspx"
> >> title="Personnel Search"
> >> description="This option is only available to HR
> >> staff"
> >> roles="HumanResourceMember" />
> >> <siteMapNode url="PersonnelInformation/YourInformation.aspx"
> >> title="Your Information"
> >> description="Your personal information"
> >> roles="User,HumanResourceMember"/>
> >> </siteMapNode

>
> >> The roles implementation works on my development machine but when I
> >> deployed the application to my company's IIS server it does not work.
> >> When I login in as a member of the user role, I expect to see the
> >> "Your Information" page. When I login as a member of the
> >> HumanResourceMember, I expect to see the "Personnel Search" page. It
> >> works wonderfully on my XP development machine but neither of the
> >> aforementioned pages show up when I login to it remotely. I don't
> >> even know how to google this problem. Please help me.

>
> >> Thank you,
> >> Jon- Hide quoted text -

>
> - Show quoted text -


Hi Gregory,

Yes, I did put the roles in the production database. I used the
aspnet_sql tool to create the whole authentication schema on my
production database at the very beginning and added this block of code
in the application's web.config file as follows:

<membership defaultProvider="CustomizedProvider">
<providers>
<add name="CustomizedProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="csEmployeeSelfService"
applicationName="EOIntranet"/>
</providers>
</membership>


<roleManager enabled="true"
defaultProvider="CustomizedRoleProvider">
<providers>
<add name="CustomizedRoleProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="csEmployeeSelfService"
applicationName="EOIntranet"/>
</providers>
</roleManager>

On your second suggestion, I did not give the roleManager provider an
application name initially. I added it in just now and it's still not
working.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem deploying web-application and web-service on same IIS server. Jan Obrestad ASP .Net 0 12-05-2007 02:54 PM
Application level roles + Item level roles... how to do it? Jéjé ASP .Net Security 0 09-26-2005 11:06 PM
Roles not working Neils Christoffersen ASP .Net Security 1 11-24-2004 02:30 PM
Deploying a web client to Win 2003 server, web edition Russ ASP .Net 2 06-21-2004 07:51 PM
deploying and re-deploying ASP.Net applications =?Utf-8?B?VG9tIE4=?= ASP .Net 2 02-04-2004 09:31 PM



Advertisments