Relative connection string to AzMan XML store when using security application block
Asked Answered
B

3

5

Is it possible to specify a relative connection string for an AzMan XML store?

My current connection string is connectionString="msxml://c:/azman.xml" but I really need to make that relative so other developers and automated builds can get the latest authorization store.

MS documentation seems to suggest that connectionString="msxml://azman.xml" should work but that throws a The request is not supported error.

EDIT: I realised that the fact I'm using AzMan through the Enterprise Library Security Application Block was important to the question.

Botswana answered 5/2, 2009 at 2:5 Comment(0)
B
6

It is possible to enter the token {currentPath} into the connection string used by the security application block.

This gave me the behavior I was after, allowing the AzMan.xml file to be accessed from with the application folder.

The connection string I am using is:

<authorizationProviders>
  <add storeLocation="msxml://{currentPath}/azman.xml"
    application="My_Application" scope="" auditIdentifierPrefix="AzMan Authorization Provider"
    type="Microsoft.Practices.EnterpriseLibrary.Security.AzMan.AzManAuthorizationProvider, Microsoft.Practices.EnterpriseLibrary.Security.AzMan, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    name="AzMan Provider" />
</authorizationProviders>
Botswana answered 5/2, 2009 at 3:58 Comment(2)
When I use this technique, in a web app, the currentPath is being evaluated as "c:\windows\system32\inetsrv" rather than the app directory. How do I get it to map to the application dir?Inosculate
Using {baseDirectory} worked for me, allowing the file to be found under the web application directory.Inosculate
M
5

Adding the ~ will make it relative to the application

<add name="AuthorizationServices" connectionString="msxml://~/App_Data/AzMan.xml"/>
Maledict answered 5/2, 2009 at 2:14 Comment(0)
A
0

If you use {currentPath}, be sure your current directory is properly set before you make the "AuthorizationFactory.GetAuthorizationProvider" call. I am also using the Enterprise Library Security Application Block. Ex. My.Computer.FileSystem.CurrentDirectory = HttpContext.Current.Request.PhysicalApplicationPath

Antalkali answered 11/3, 2010 at 15:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.