Переглянути джерело

[Authentication] Added log for token validation error

develop
Robin Thoni 9 роки тому
джерело
коміт
7401309398

+ 20
- 0
Authentication/Authentication.csproj Переглянути файл

@@ -30,6 +30,26 @@
30 30
     <WarningLevel>4</WarningLevel>
31 31
   </PropertyGroup>
32 32
   <ItemGroup>
33
+    <Reference Include="Logs, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
34
+      <HintPath>..\packages\Logs.dll.1.2.5\lib\net45\Logs.dll</HintPath>
35
+      <Private>True</Private>
36
+    </Reference>
37
+    <Reference Include="Microsoft.Practices.EnterpriseLibrary.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
38
+      <HintPath>..\packages\EnterpriseLibrary.Common.6.0.1304.0\lib\NET45\Microsoft.Practices.EnterpriseLibrary.Common.dll</HintPath>
39
+      <Private>True</Private>
40
+    </Reference>
41
+    <Reference Include="Microsoft.Practices.EnterpriseLibrary.Data, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
42
+      <HintPath>..\packages\EnterpriseLibrary.Data.6.0.1304.0\lib\NET45\Microsoft.Practices.EnterpriseLibrary.Data.dll</HintPath>
43
+      <Private>True</Private>
44
+    </Reference>
45
+    <Reference Include="Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
46
+      <HintPath>..\packages\EnterpriseLibrary.Logging.6.0.1304.0\lib\NET45\Microsoft.Practices.EnterpriseLibrary.Logging.dll</HintPath>
47
+      <Private>True</Private>
48
+    </Reference>
49
+    <Reference Include="Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
50
+      <HintPath>..\packages\EnterpriseLibrary.Logging.Database.6.0.1304.0\lib\NET45\Microsoft.Practices.EnterpriseLibrary.Logging.Database.dll</HintPath>
51
+      <Private>True</Private>
52
+    </Reference>
33 53
     <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
34 54
       <SpecificVersion>False</SpecificVersion>
35 55
       <HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>

+ 3
- 0
Authentication/Business/JWT/TokenValidationHandler.cs Переглянути файл

@@ -9,6 +9,8 @@ using System.ServiceModel.Security.Tokens;
9 9
 using System.Threading;
10 10
 using System.Threading.Tasks;
11 11
 using iiie.Authentication.DBO;
12
+using iiie.Logs.DataAccess;
13
+using iiie.Logs.DBO;
12 14
 
13 15
 namespace iiie.Authentication.Business.JWT
14 16
 {
@@ -102,6 +104,7 @@ namespace iiie.Authentication.Business.JWT
102 104
             }
103 105
             catch (Exception e)
104 106
             {
107
+                OpResult<bool>.Error(ResultStatus.LoginError, e).Log();
105 108
                 statusCode = HttpStatusCode.Unauthorized;
106 109
             }
107 110
             return Task<HttpResponseMessage>.Factory.StartNew(() =>

+ 5
- 0
Authentication/packages.config Переглянути файл

@@ -1,5 +1,10 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <packages>
3
+  <package id="EnterpriseLibrary.Common" version="6.0.1304.0" targetFramework="net45" />
4
+  <package id="EnterpriseLibrary.Data" version="6.0.1304.0" targetFramework="net45" />
5
+  <package id="EnterpriseLibrary.Logging" version="6.0.1304.0" targetFramework="net45" />
6
+  <package id="EnterpriseLibrary.Logging.Database" version="6.0.1304.0" targetFramework="net45" />
7
+  <package id="Logs.dll" version="1.2.5" targetFramework="net45" />
3 8
   <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45" />
4 9
   <package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45" />
5 10
   <package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />

Завантаження…
Відмінити
Зберегти