Giter Site home page Giter Site logo

Comments (8)

schwarzie2478 avatar schwarzie2478 commented on May 28, 2024

I would really like to have AD integration for our internal surveys and I'm looking into the code how it is done now.
Is it already possible? Anyone already have something started or ideas how I could do it now?

The security seems to be very well isolated in one place, so it shouldn't be too hard to replace Form authentication with AD.

We mostly use AD Groups to assign rights to users, so this would be my approach to manage the access for users to enter the site.

You would get all the rights of all the groups you are in...

from surveyproject.

rubberduck203 avatar rubberduck203 commented on May 28, 2024

Windows auth already uses AD to perform authorization, so that's the route I would take when attempting this change. No need to query the AD directly by hand.

I'm not sure the exent of the internal code changes that would be necessary to support it, but this stackoverflow question details how to use User.IsInrole() to determine if a user has the proper role.

from surveyproject.

schwarzie2478 avatar schwarzie2478 commented on May 28, 2024

I did a quick test with enabling Windows authentication on the site.
I first created an user with my AD account name ( Domain\userid) and a random password).
Added a little code to pagebase to retrieve info for an AD user from the user repository and voila, I was always logged in ( can't even log out now; :-) )

This could be put in a ADUserInfoProvider class to replace the FormUserInfoProvider.
With the additional check for AD groups inside to check for roles, this should be usefull to most people I think.

I'll try to set up something up.

from surveyproject.

fwsmaster avatar fwsmaster commented on May 28, 2024

Any suggestions/ solutions or code most welcome! I wonder if there's a way to not having to create the user in SP first though? Challenge will then be how to combine/.link the AD account with the SP user roles /rights.

from surveyproject.

rubberduck203 avatar rubberduck203 commented on May 28, 2024

That's what I was thinking. What really needs to be is two different implementations of one interface with a configuration setting telling the app which one to use at run time.

from surveyproject.

rubberduck203 avatar rubberduck203 commented on May 28, 2024

I poked at the code. Bit, and it seems that the abstraction already exists. There's a FormsUserProvider that implements an INSursveyUserProvider interface. There's also an INSurveyPrincipal somewhere that will likely need a new AD implementation.

from surveyproject.

schwarzie2478 avatar schwarzie2478 commented on May 28, 2024

I was started on setting an ADUserProvider class for meself already. I'm trying to keep code duplication to a minimum. But I don't know if I should change the FormUserProvider to extract common code or leave it as is...

from surveyproject.

 avatar commented on May 28, 2024

Did anyone get anywhere with this. It's all giving me a headache!

from surveyproject.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.