Sécurisation de l'accès à l'api
This commit is contained in:
parent
c8500cb7d4
commit
8bcb404829
2 changed files with 15 additions and 14 deletions
|
|
@ -1,10 +1,11 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
|
||||||
</configSections>
|
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
</startup>
|
</startup>
|
||||||
|
<appSettings>
|
||||||
|
<add key="ApiAuthentication" value="admin:adminpwd"/>
|
||||||
|
</appSettings>
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ namespace MediaTekDocuments.dal
|
||||||
String authenticationString;
|
String authenticationString;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
authenticationString = "admin:adminpwd";
|
authenticationString = ConfigurationManager.AppSettings["ApiAuthentication"];
|
||||||
api = ApiRest.GetInstance(uriApi, authenticationString);
|
api = ApiRest.GetInstance(uriApi, authenticationString);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue