Adding New Users to EnterpriseLibrary.Security App

Topics: Enterprise Library Core, Security Application Block
May 16, 2008 at 9:14 PM
I have a ASP .Net Web application in VB using VSTS 2008. I have added the Enterprise library and configured it. Now I want to add some new Users and Passwords to the database to test out the authentication. I do see any methods in the Enterprise Library to do this.

How do I add new users with passwrords for the EnterpriseLibrary.Security function to authenticate?
Can this be done programmatically?
Are ther any examples of this?
May 16, 2008 at 10:14 PM
Edited May 16, 2008 at 10:15 PM

Hi,

You're really using ASP.NET's authentication features there; EntLib's security block only does authorization and caching of security information. Look at EntLib's Security Quickstart or this how-to article from P&P for examples.

Hope this helps,
Fernando


dbaechtel wrote:
I have a ASP .Net Web application in VB using VSTS 2008. I have added the Enterprise library and configured it. Now I want to add some new Users and Passwords to the database to test out the authentication. I do see any methods in the Enterprise Library to do this.

How do I add new users with passwrords for the EnterpriseLibrary.Security function to authenticate?
Can this be done programmatically?
Are ther any examples of this?



May 17, 2008 at 2:38 AM

Thanks for the Reply.

Can you connect the dots a little more for me?

I went through the EntLib's Security Quickstart and I didn't see any mention of how to connect a Username/Password database to the Security block. I went through the P&P article and it didn't talk anything about Entlib's Seciurity block or how to make use of it. I understand for the Entlib prsentations that I should not use Active Directory for my authentication.

How can Entlib's Security block do Authentication without a username/password database? How does it get access to the information needed to do authentication?

Is there any complete end-to-end sample of using Entlib's Security block to do authentication of username/passwords that includes setting up the database and adding usernames and passwords to this database?


fsimonazzi wrote:

Hi,

You're really using ASP.NET's authentication features there; EntLib's security block only does authorization and caching of security information. Look at EntLib's Security Quickstart or this how-to article from P&P for examples.

Hope this helps,
Fernando


dbaechtel wrote:
I have a ASP .Net Web application in VB using VSTS 2008. I have added the Enterprise library and configured it. Now I want to add some new Users and Passwords to the database to test out the authentication. I do see any methods in the Enterprise Library to do this.

How do I add new users with passwrords for the EnterpriseLibrary.Security function to authenticate?
Can this be done programmatically?
Are ther any examples of this?






May 17, 2008 at 4:45 AM
Edited May 17, 2008 at 4:49 AM
Only when you have role and/or identity, you can use Entlib's security block to authorize and unauthorize your role and/or identity to access some resources, for example, menu item, URL, button and link etc. That means you need to do authenticantion first. Entlib's security block doesn't provide this. In ASP.NET 2.0 there is a membership can help you. (http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx)


Chester in Calgary