Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Elad Lachmi 112 posts 144 karma points
    Oct 17, 2012 @ 10:25
    Elad Lachmi
    0

    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

     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()

     

    Anyone seen this before?

    Thank you!

  • Adrian Holland 29 posts 106 karma points
    Oct 19, 2012 @ 06:04
    Adrian Holland
    0

    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?

  • Elad Lachmi 112 posts 144 karma points
    Oct 22, 2012 @ 19:48
    Elad Lachmi
    0

    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.

  • Adrian Holland 29 posts 106 karma points
    Oct 23, 2012 @ 01:01
    Adrian Holland
    0

    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

  • Elad Lachmi 112 posts 144 karma points
    Oct 23, 2012 @ 10:19
    Elad Lachmi
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft