Authentication Issues in Enterprise Caching when using Web Services

Topics: Caching Application Block
Jan 7, 2008 at 6:02 PM

This post is related to two other recent posts of mine:

...but I thought I would make a new post because I have discovered my problem -- having to do with authentication -- and I thought this might be valuable to others to name it accordingly in a new thread.

I have built a franework which is like a wrapper for the Enterprise Caching Framework. The idea was to use this in any kind of application ( i.e. web forms, web services, windows forms etc. ) that needs to do caching of some sort.

I have configured my cache manager to do database caching which is working fine. When I perform tests from a windows forms app, I get the results I am looking for: I can add, remove and retreive objects from the cache and the scheduler removes objects that are expired.

However, when I test this from a web service, I get different behaviour. I can add, remove and retrieve objects from the cache but the scheduler does not remove objects from the cache that have expired. Upon further investigation using Sql Profiler I saw the scheduler making calls to the database but that it did not have sufficient rights to do so.

This is because the web service is running under an account that has sufficient rights while the background scheduler is running as an account ( the same as the app pool ) which does not.

I would rather not change the user that the app pool runs under ( as a note: when I do change the user, all is well ), but I suppose I could give the service user ( the one the app pool runs under ) privileges on the database. Does anyone have any other ideas?

Jan 7, 2008 at 6:28 PM
...actually, the app pool is running as network service, so that would not be a viable option to give it access to the database.