I am creating a console application that needs access to umbraco members in order to do some maintanence jobs.
What I want to do is get all users in a specific role with
Roles.GetUsersInRole("Users");
I added an app.config file and added the assembliens I thought were required. I might be missing something, since I get the following error:
Unhandled Exception: System.TypeLoadException: Could not load type 'umbraco.providers.members.UmbracoRoleProvider' from assembly 'System.Web, Version=4.0.0.0. at System.Web.Security.Roles.Initialize()
I think you'll find that you need a HTTPContext - see this post for more information.
You could try implementing the logic inside a class within your site and exposing it via /base as a web service then kicking it off with a windows scheduler job or via a back office dashboard UI component ... or any other means you like.
Another option would be to use the task scheduler plugin?
If you use the /base option, I guess you could lock it down by only exposing /base to localhost only via IIS
Also here is a bit of a discussion on the topic umbraco base and security We are probably going to have to cross this bridge as part of an upcoming project so will let you know which solution works best for us if we do.
Using Umbraco membership in console application
Hi,
I am creating a console application that needs access to umbraco members in order to do some maintanence jobs.
What I want to do is get all users in a specific role with
I added an app.config file and added the assembliens I thought were required. I might be missing something, since I get the following error:
Anyone seen this before?
Thank you!
I think you'll find that you need a HTTPContext - see this post for more information.
You could try implementing the logic inside a class within your site and exposing it via /base as a web service then kicking it off with a windows scheduler job or via a back office dashboard UI component ... or any other means you like.
Another option would be to use the task scheduler plugin?
Thanks for the info Adrian.
I have used /base before. My only issue with this is how do I secure the /base service from unauthorized access.
When I wrote a /base extension before, it was internet facing anyway, so I didn't have real security concerns.
In this case this service will trigger sensetive internal automatic procedures, and I don't want it to be freely accessible.
Hi Elad,
If you use the /base option, I guess you could lock it down by only exposing /base to localhost only via IIS
Also here is a bit of a discussion on the topic umbraco base and security We are probably going to have to cross this bridge as part of an upcoming project so will let you know which solution works best for us if we do.
Cheers,
Adrian
Ahh... Might be a silly question, but how do I add a virtual (routing) directory live /base to the allow list?
From what I understand, the web.config controls this for the directory it is placed in.
is working on a reply...