Ask a Question related to ASP.NET Security, Design and Development.
-
Verify User Group from ASP.NET
Hello,
I'm a little uncertain about what I'm asking so please be gentle.
I (think) I want to be able to identify and authenticate the currently
logged on user against the Active Directory. We have a 2000 domain server
and 2000 clients on our network.
The idea behind it all is am storing documents in a SQL database and have a
list of groups who can view them. If the currently logged on user is not in
one of those groups then they should not be permitted to open the document.
I'm using VB.NET in ASP.NET to develop with and would appreciate any ideas
of where to look for examples of what to do.
Thanks,
<M>ike
Guest
-
Contribute User unable to connect ...cannot verify your connection information
I have a user that has a specific issue with Contribute. He was able in prior weeks able to connect - we are connecting via a LAN - with... -
Verify if a user exist at registration
Hello and thanks in advance. I created a login form that sends data to another cfm page . I want to make sure that the username is not already... -
NDS user and group query
Greetings! I would like to create a web page that will allow users to look at my Novell NDS tree groups and see what users are members, and look... -
Specify more than 1 supplementary group for a user ??
Whenever I do: usermod -G groupname username ..... any existing supplementary group of username, as shown from /etc/group, gets removed and... -
how to add user group member
Hi folks, I have problem when add user into group member with admintool it has been limited up to hundred...user (don't know how many) when i add... -
Joe Kaplan \(MVP - ADSI\) #2
Re: Verify User Group from ASP.NET
If you are using Windows authentication with IIS and ASP.NET (anonymous
disabled in IIS, authentication set to Windows in web.config), then all you
have to do is call Context.User.IsInRole("domain\group name")
That will return true or false if the currently authenticated user is in the
group you specified. The Windows security system does all the heavy lifting
for you.
If you aren't using Windows auth, this is vastly more painful, but can be
done by looking up the user's groups programmatically.
Joe K.
"<M>ike" <mikedotdinnisatabraxas-ukdotcom> wrote in message
news:ecv9ZtfWEHA.556@tk2msftngp13.phx.gbl...a> Hello,
>
> I'm a little uncertain about what I'm asking so please be gentle.
>
> I (think) I want to be able to identify and authenticate the currently
> logged on user against the Active Directory. We have a 2000 domain server
> and 2000 clients on our network.
>
> The idea behind it all is am storing documents in a SQL database and havein> list of groups who can view them. If the currently logged on user is notdocument.> one of those groups then they should not be permitted to open the>
> I'm using VB.NET in ASP.NET to develop with and would appreciate any ideas
> of where to look for examples of what to do.
>
> Thanks,
>
> <M>ike
>
>
Joe Kaplan \(MVP - ADSI\) Guest
-
Re: Verify User Group from ASP.NET
Wow,
That's pretty simple. Compared to the old classic ASP days, it's a doddle!
Cheers,
<M>ike
"Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@removethis.accenture.com> wrote
in message news:et7p0JhWEHA.1380@TK2MSFTNGP09.phx.gbl...you> If you are using Windows authentication with IIS and ASP.NET (anonymous
> disabled in IIS, authentication set to Windows in web.config), then allthe> have to do is call Context.User.IsInRole("domain\group name")
>
> That will return true or false if the currently authenticated user is inlifting> group you specified. The Windows security system does all the heavyserver> for you.
>
> If you aren't using Windows auth, this is vastly more painful, but can be
> done by looking up the user's groups programmatically.
>
> Joe K.
>
> "<M>ike" <mikedotdinnisatabraxas-ukdotcom> wrote in message
> news:ecv9ZtfWEHA.556@tk2msftngp13.phx.gbl...> > Hello,
> >
> > I'm a little uncertain about what I'm asking so please be gentle.
> >
> > I (think) I want to be able to identify and authenticate the currently
> > logged on user against the Active Directory. We have a 2000 domainhave> > and 2000 clients on our network.
> >
> > The idea behind it all is am storing documents in a SQL database andideas> a> in> > list of groups who can view them. If the currently logged on user is not> document.> > one of those groups then they should not be permitted to open the> >
> > I'm using VB.NET in ASP.NET to develop with and would appreciate any>> > of where to look for examples of what to do.
> >
> > Thanks,
> >
> > <M>ike
> >
> >
>
Guest
-
Re: Verify User Group from ASP.NET
Ok,
A slight variant of the same theme, if (for example) that I (current logged
on user) am a member of the Administrators group and I use the IsInRole test
against a subgroup that I have not been explicity added to but still have
higher permissions than I will get 'False' as the result. Is there a way of
testing overall permissions rather than explicit group names, or does this
then start to get into problems?
<M>ike
Guest
-
Joe Kaplan \(MVP - ADSI\) #5
Re: Verify User Group from ASP.NET
It sounds like what you want to do is roll up your AD groups into
application-specific role descriptions. For example, you might want to put
domain\admins1, domain\admins2 and domain\admins3 into a role in your
application call Administrators.
If that is what you want and you are using Win2K3 server for your web
server, the best thing to check out is Authorization Manager (AzMan). It
allows you to build application specific roles, tasks and operations and map
them to users and groups at runtime.
You could also build something similar in ASP.NET, but you'd have to write
it yourself. One thing you might do is write an HttpModule that examines
the WindowsPrincipal returned by the Windows authentication module and maps
the user name and Windows groups into application specific roles. You would
then create a new IPrincipal object (probably based on the GenericPrincipal
class, but you can write your own easily if you want) that contains your
application specific roles. Then, you would test against those roles in
your application instead of the groups directly.
Such a thing is more work, but might be worth it. Unfortunately I don't
have a sample to point you towards. However, the .NET role-based
authorization framework is very flexible and doing this kind of stuff is not
very hard.
Joe K.
"<M>ike" <mikedotdinnisatabraxas-ukdotcom> wrote in message
news:OkAS$epWEHA.1368@TK2MSFTNGP10.phx.gbl...logged> Ok,
>
> A slight variant of the same theme, if (for example) that I (currenttest> on user) am a member of the Administrators group and I use the IsInRoleof> against a subgroup that I have not been explicity added to but still have
> higher permissions than I will get 'False' as the result. Is there a way> testing overall permissions rather than explicit group names, or does this
> then start to get into problems?
>
> <M>ike
>
>
Joe Kaplan \(MVP - ADSI\) Guest



Reply With Quote

