PDA

View Full Version : دستکاری در web.config



saed2006
جمعه 13 فروردین 1389, 00:11 صبح
دوستان برای راه اندازی قسمتی از برنامه باید در web.config دستکاری کنم

طبق این دستور:

Setting the ArcGIS identity manually

If Visual Studio is not available on the Web server computer, you can manually set or update the ArcGIS identity.

Open the web.config file in a text editor, such as Notepad.
Find the identity XML tag. The contents of this tag may vary, depending on whether the identity was encrypted when it was added. An encrypted identity will look like this:

<identity configProtectionProvider="DataProtectionConfigurationProvider">
<EncryptedData>
<CipherData>
<CipherValue>AQA…vA==</CipherValue>
</CipherData>
<EncryptedData>
</identity>


If the identity tag does not exist, you can create it as shown below. Make sure it is within the <system.web> section of web.config.
Set or update the identity to a user in the agsusers group on the GIS server. See above for requirements for the user account.

The following is the recommended procedure to set and encrypt the identity:
Modify the identity XML tag to contain the account information you wish to use. Use the standard format for an identity tag in ASP.NET, similar to the following:
<identity impersonate=”true” userName=”mydomain\myusername” password=”mypassword” />
If using a local machine account, the domain name (mydomain) may be omitted from the userName value, or the local machine name may be used. If the Web server and GIS server are on separate machines, you must omit the machine name for local accounts.

Save the web.config file.
Test the web application on this Web server to ensure that the identity is correctly recognized.
Encrypt the identity using the standard aspnet_regiis tool. Although normally the web.config file cannot be viewed by browser users, if the Web server is compromised it may be possible for the credentials to be viewed by unauthorized users. To use aspnet_regiis, open a .NET command prompt from Start --> (All) Programs --> Microsoft .NET Framework SDK v2.0 --> SDK Command Prompt.
Type in the command to encrypt the identity section in web.config. For example:

aspnet_regiis -pe "system.web/identity" -app "/MyWebMappingApp" -prov "DataProtectionConfigurationProvider"
where "/MyWebMappingApp" is the URL of the web application on the local IIS server.

If the website uses the File System option now availabe in Visual Studio, where the built-in Web server is used, the following will encrypt the identity section using a file path (note the -pef option and omission of the -app option):

aspnet_regiis -pef "system.web/identity" "C:\MyWebFolder\MyWebMappingApp" -prov "DataProtectionConfigurationProvider"
The above examples use the .NET DataProtectionConfigurationProvider, which uses a machine-specific key for encryption. If you need to deploy the same application to multiple servers, such as in a Web Farm, you should use the RSAProtectedConfigurationProvider, which allows export and import of encryption keys. See this Microsoft article for details: How To: Encrypt Configuration Sections in ASP.NET 2.0 Using RSA.
The identity is now updated and encrypted in the web.config file. The web mapping application should run normally and use the encrypted identity to access the ArcGIS Server local resource.
An alternative option to the encryption with aspnet_regiis is to encrypt the credentials for the identity within the Registry. To do this, use the Aspnet_setreg utility. This utility is available, with instructions, from Microsoft at


من همه این ها رو انجام دادم تا یک خاصیت اضافه بشه به تگ identfy اما نمیدونم مشکل کجاست که این اتفاق نمی افته

saed2006
جمعه 13 فروردین 1389, 00:24 صبح
دوستان من میخوام توی تگ identfy این رو


<identity configProtectionProvider="DataProtectionConfigurationProvider">
<EncryptedData>
<CipherData>
<CipherValue>AQA…vA==</CipherValue>
</CipherData>
<EncryptedData>
</identity>
بنویسم
کسی نیست کمک کنه؟

saed2006
جمعه 13 فروردین 1389, 17:59 عصر
اقا کسی نمیدونه چجوری یک خاصیت رو به تگ identfy در webconfig اضافه کنیم؟