The type AuthorizationProvider cannot be constructed. You must configure the container to supply this value.

Topics: Security Application Block
May 10, 2011 at 8:37 PM

For some reason I just can't get this to work.  Here is my code:

IAuthorizationProvider azmanAuth = EnterpriseLibraryContainer.Current.GetInstance<AuthorizationProvider>("AzManProvider");
Here is the config:

<configSections>
    <section name="securityConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Security.Configuration.SecuritySettings, Microsoft.Practices.EnterpriseLibrary.Security, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections>

<securityConfiguration defaultAuthorizationInstance="AzManProvider">
    <authorizationProviders>
        <add type="Microsoft.Practices.EnterpriseLibrary.Security.AzMan.AzManAuthorizationProvider, Microsoft.Practices.EnterpriseLibrary.Security.AzMan, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
         storeLocation="msxml:c:\AzManStore.xml" application="AutomatedStipendRequest"
         auditIdentifierPrefix="AzManProvider" name="AzManProvider" />
    </authorizationProviders>
</securityConfiguration>

I just keep getting this error:

The type AuthorizationProvider cannot be constructed. You must configure the container to supply this value.

Please help. Thanks.

May 11, 2011 at 11:49 AM

Hi,

Basic question is - have you supplied the correct attribute values for your AzMan provider in the config based from the setting of your actual AzMan Settings in your server/workstation (i.e. Application and Store Location)?

Gino Terrado
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com

May 11, 2011 at 2:14 PM

Yes, the store location and application are exactly as they are in the AzMan GUI. I can get this to work using the COM object so I know it works fine.

May 11, 2011 at 6:56 PM

Okay, so I used this:

IAuthorizationProvider azmanAuth = AuthorizationFactory.GetAuthorizationProvider("AzManProvider");
And it works fine. Nothing changed in the config. Weird.