Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   asp.net 2.0 roles not working when deploying to web server (http://www.velocityreviews.com/forums/t523392-asp-net-2-0-roles-not-working-when-deploying-to-web-server.html)

Homer 07-19-2007 10:00 PM

asp.net 2.0 roles not working when deploying to web server
 
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


clintonG 07-20-2007 12:02 AM

Re: asp.net 2.0 roles not working when deploying to web server
 
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" <HomerS007@gmail.com> wrote in message
news:1184882446.131681.157690@m37g2000prh.googlegr 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
>




Homer 07-20-2007 12:36 AM

Re: asp.net 2.0 roles not working when deploying to web server
 
On Jul 19, 5:02 pm, "clintonG" <nob...@nowhere.com> 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" <HomerS...@gmail.com> wrote in message
>
> news:1184882446.131681.157690@m37g2000prh.googlegr 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.


Cowboy \(Gregory A. Beamer\) 07-20-2007 02:15 AM

Re: asp.net 2.0 roles not working when deploying to web server
 
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" <HomerS007@gmail.com> wrote in message
news:1184882446.131681.157690@m37g2000prh.googlegr 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
>




Cowboy \(Gregory A. Beamer\) 07-20-2007 02:18 AM

Re: asp.net 2.0 roles not working when deploying to web server
 
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)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in
message news:esjbLPnyHHA.2172@TK2MSFTNGP06.phx.gbl...
> 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" <HomerS007@gmail.com> wrote in message
> news:1184882446.131681.157690@m37g2000prh.googlegr 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
>>

>
>




Homer 07-20-2007 05:48 AM

Re: asp.net 2.0 roles not working when deploying to web server
 
On Jul 19, 7:18 pm, "Cowboy \(Gregory A. Beamer\)"
<NoSpamMgbwo...@comcast.netNoSpamM> 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)" <NoSpamMgbwo...@comcast.netNoSpamM> wrote in
> messagenews:esjbLPnyHHA.2172@TK2MSFTNGP06.phx.gbl. ..
>
>
>
> > 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" <HomerS...@gmail.com> wrote in message
> >news:1184882446.131681.157690@m37g2000prh.googleg 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.



All times are GMT. The time now is 09:57 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.