473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Using SQL 2005 Appicatioin Roles with ASP.NET 2.0.

Hi everybody!

I can not understand how to use SQL2005 Appicatioin Roles (AR) with
ASP.NET 2.0? The tricky thing here is that you have to set up your
connection string to use integrated authentication (otherwise you lost
auditing ability of Application Role). OK. After you set up AR in SQL
Server how the application knows about AR? Where do you set up it?

Thanks, CuteDeveloper

Aug 17 '07 #1
2 1500
On Aug 17, 6:31 pm, CuteDevelo...@gmail.com wrote:
Hi everybody!

I can not understand how to use SQL2005 Appicatioin Roles (AR) with
ASP.NET 2.0? The tricky thing here is that you have to set up your
connection string to use integrated authentication (otherwise you lost
auditing ability of Application Role). OK. After you set up AR in SQL
Server how the application knows about AR? Where do you set up it?

Thanks, CuteDeveloper
Hi CuteDeveloper,

ASP.NET creates database and uses RoleProvider to access this
database. That's why you cannot use AR without any database.
Application knows about AR by settings in web.config file. To use
roles in your application you should add the following in web.config:

<roleManager defaultProvider="OdbcRoleProvider"
enabled="true"
cacheRolesInCookie="true"
cookieName=".ASPROLES"
cookieTimeout="30"
cookiePath="/"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
cookieProtection="All" >
<providers>
<clear />
<add
name="OdbcRoleProvider"
type="Samples.AspNet.Roles.OdbcRoleProvider"
connectionStringName="OdbcServices"
applicationName="SampleApplication"
writeExceptionsToEventLog="false" />
</providers>
</roleManager>

More about Roles implementation read msdn articles -
http://msdn2.microsoft.com/en-us/library/8fw7xh74.aspx

Regards,
Alexander Kleshchevnikov
MCP
www.klalex.com

Aug 17 '07 #2
On Aug 17, 11:40 am, seigo <seigo...@gmail.comwrote:
On Aug 17, 6:31 pm, CuteDevelo...@gmail.com wrote:
Hi everybody!
I can not understand how to use SQL2005 Appicatioin Roles (AR) with
ASP.NET 2.0? The tricky thing here is that you have to set up your
connection string to use integrated authentication (otherwise you lost
auditing ability of Application Role). OK. After you set up AR in SQL
Server how the application knows about AR? Where do you set up it?
Thanks, CuteDeveloper

Hi CuteDeveloper,

ASP.NET creates database and uses RoleProvider to access this
database. That's why you cannot use AR without any database.
Application knows about AR by settings in web.config file. To use
roles in your application you should add the following in web.config:

<roleManager defaultProvider="OdbcRoleProvider"
enabled="true"
cacheRolesInCookie="true"
cookieName=".ASPROLES"
cookieTimeout="30"
cookiePath="/"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
cookieProtection="All" >
<providers>
<clear />
<add
name="OdbcRoleProvider"
type="Samples.AspNet.Roles.OdbcRoleProvider"
connectionStringName="OdbcServices"
applicationName="SampleApplication"
writeExceptionsToEventLog="false" />
</providers>
</roleManager>

More about Roles implementation read msdn articles -http://msdn2.microsoft.com/en-us/library/8fw7xh74.aspx

Regards,
Alexander Kleshchevnikov
MCPwww.klalex.com

Thank you for a quick response, Alex!
You gave me the right direction and I found a nice explanation here:
http://odetocode.com/Articles/427.aspx

Regards,
Eugene



..

Aug 17 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
by: Cowboy \(Gregory A. Beamer\) | last post by:
There seems to be a lot of confusion on the versions of Visual Studio 2005. My latest blog entry covers the different versions: Main URL:...
3
by: Carl M. | last post by:
Okay, I'm 18 hours into this now and am at a loss. What I've done is create an application on my local workstation using VWD Express using the membership/roles provider and SQL Server Express...
1
by: Matt | last post by:
I'm not entirely sure if this is the best place to post this; if it is not, kindly redirect me to the proper posting area. I'm deploying a Windows Forms application using VB 2005 on top of SQL...
1
by: keithb | last post by:
I developed a web site that uses sql server express for permissions and roles. Now I need to deploy it on a server that uses sql server 2005 standard edition instead of sql server express. What do...
1
by: Screenbert | last post by:
After finding nothing anywhere in google I am posting this so everyone can benefit by it. The formating is not pretty since I copied it from my word document, but you should benefit by it. ...
0
by: screenbert | last post by:
Managing DHCP Servers using C# They said it was impossible. It couldn't be done. But you can in fact manage DHCP servers using C#. This includes creating and deleting Scopes, SuperScopes,...
0
by: assia | last post by:
Hello, I have a question concerning security in SSAS 2005. I create two roles, let's say, role 1 and role 2. I have a user, let's Alice that belongs to the two roles. These roles are set on one...
2
by: SpaceMarine | last post by:
ok im new to SQL Server 2005, from 2000. my webapps use integrated security, and run under: \\MYMACHINE\ASPNET ....in 2000 it was a pretty simple thing to create a new db user for this...
2
by: JimL | last post by:
Hello group, We have recently come up with a problem where SQLServer 2005 differs from 2000. We have an application role, which needs to run DDL to alter tables etc. The documentation for...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.