Copied to clipboard

Flag this post as spam?

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


  • Darren Clark 52 posts 249 karma points
    Aug 12, 2014 @ 17:28
    Darren Clark
    0

    Umbraco 7 MVC auto login for front end members

    Hi

    Could someone point me in the right direction. I have seen a few packages out there but they seem to be related to back office AD integration and i have not came across any that are used for front end apart from one that only worked with webforms and it had a login control which we do not need.

    We want to use active directory to authenticate members on the site without a login control. We want the AD user to be added as a umbraco member with their AD Roles added into umbraco so we can restrict access to parts of the site via these roles.

    Is this possible?

    Would we create a custom role provider to achieve this and would we need a custom membership provider also???

    Regards Darren

  • Ian Burrett 7 posts 71 karma points
    Aug 15, 2014 @ 17:14
    Ian Burrett
    0

    Hey there Darren,

    How are you doing, I remembered you from the Level 2 course in London.

    We had one of our guys looking at this too - I'll send you a zip over if you like - which is the best email address to get you on?

    All the best!

    Burt ;o)

     

  • Darren Clark 52 posts 249 karma points
    Aug 15, 2014 @ 17:32
    Darren Clark
    0

    How you doing big man (Buzza),

    Yeh send me that zip file so i can have a look. But the gazmesiter here resolved the issues in mvc by overriding the FilterConfig Class in MVC and setting up a custom class implementing IAuthorizationFilter and then we created a custom role provider that pulled roles from Active Directory.

    Cheers Big Man!

  • Markus Roessler 10 posts 30 karma points
    Jul 16, 2015 @ 12:04
    Markus  Roessler
    0

    Dear Ian, dear Darren,

    I know this post is more then one year old, but I have the same problem. Is there a possibility to get your code? Or can you explain the solution here?

    Best regards from germany

    Markus

  • Darren Clark 52 posts 249 karma points
    Jul 31, 2015 @ 14:40
    Darren Clark
    0

    Hi Markus,

    Send me your email address and i will send you the files needed to achieve this, it is not an ideal solution and the querying of AD can be improved in the code. But essentially all you need is two classes and some web.config app settings.

    The first thing you need is a custom role provider class which implements RoleProvider and overrides all the methods.

    The second thing you need is a custom FilterConfig class which implements System.Web.Mvc.IAuthorizationFilter and has a OnAuthorization method.

    The third thing to do is add one line to the Global.ascx.cs file on the ApplicationStarted method to initialise the new Filter class.

    Then add the required appsettings and new role provider into the web.config

    Regards Darren

Please Sign in or register to post replies

Write your reply to:

Draft