From fc0bb28b1f7b3faeb7b02409c197c236872807e9 Mon Sep 17 00:00:00 2001 From: Stephan Traub Date: Sun, 24 May 2020 14:44:44 +0200 Subject: [PATCH] #42 - improve the appearance of the messages in the UI --- .gitignore | 2 ++ privacyIDEAADFSProvider.sln | 6 ++++++ privacyIDEAADFSProvider/AuthPage.html | 1 + privacyIDEAADFSProvider/OTPprovider.cs | 14 ++++++++++++++ privacyIDEAADFSProvider/Properties/AssemblyInfo.cs | 4 ++-- 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e77edde..702aa3e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. +Tester/ + # User-specific files *.suo *.user diff --git a/privacyIDEAADFSProvider.sln b/privacyIDEAADFSProvider.sln index be06f50..868c92d 100644 --- a/privacyIDEAADFSProvider.sln +++ b/privacyIDEAADFSProvider.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.29609.76 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "privacyIDEAADFSProvider", "privacyIDEAADFSProvider\privacyIDEAADFSProvider.csproj", "{3A9A54D7-F23B-469C-BA61-8C69CBAF50F5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Tester\Tester.csproj", "{42F9F1AF-8AB7-4CBA-96E8-88B4B40538AE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {3A9A54D7-F23B-469C-BA61-8C69CBAF50F5}.Debug|Any CPU.Build.0 = Debug|Any CPU {3A9A54D7-F23B-469C-BA61-8C69CBAF50F5}.Release|Any CPU.ActiveCfg = Release|Any CPU {3A9A54D7-F23B-469C-BA61-8C69CBAF50F5}.Release|Any CPU.Build.0 = Release|Any CPU + {42F9F1AF-8AB7-4CBA-96E8-88B4B40538AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {42F9F1AF-8AB7-4CBA-96E8-88B4B40538AE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {42F9F1AF-8AB7-4CBA-96E8-88B4B40538AE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {42F9F1AF-8AB7-4CBA-96E8-88B4B40538AE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/privacyIDEAADFSProvider/AuthPage.html b/privacyIDEAADFSProvider/AuthPage.html index 8953d3f..500f798 100644 --- a/privacyIDEAADFSProvider/AuthPage.html +++ b/privacyIDEAADFSProvider/AuthPage.html @@ -6,6 +6,7 @@

#C_MESSAGE#

#ERROR#

+
diff --git a/privacyIDEAADFSProvider/OTPprovider.cs b/privacyIDEAADFSProvider/OTPprovider.cs index 3b98625..8c299a6 100644 --- a/privacyIDEAADFSProvider/OTPprovider.cs +++ b/privacyIDEAADFSProvider/OTPprovider.cs @@ -8,6 +8,7 @@ using System.Runtime.Serialization.Json; using System.Xml; using System.Xml.Linq; +using System.Collections; namespace privacyIDEAADFSProvider { @@ -276,6 +277,19 @@ private string getJsonNode(string jsonResponse, string nodename) try { var xml = XDocument.Load(JsonReaderWriterFactory.CreateJsonReader(Encoding.ASCII.GetBytes(jsonResponse), new XmlDictionaryReaderQuotas())); + //Console.WriteLine(xml); + // return a list if messages node is called + if (nodename == "messages") + { + string html_message = ""; + IEnumerable childElements = + from el in xml.Descendants(nodename).Elements() + select el; + foreach (XElement el in childElements) + html_message += el.Value+"
"; + return(html_message); + } + return xml.Descendants(nodename).Single().Value; } catch(Exception ex) diff --git a/privacyIDEAADFSProvider/Properties/AssemblyInfo.cs b/privacyIDEAADFSProvider/Properties/AssemblyInfo.cs index 2fa1e8a..178192d 100644 --- a/privacyIDEAADFSProvider/Properties/AssemblyInfo.cs +++ b/privacyIDEAADFSProvider/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.8.1")] -[assembly: AssemblyFileVersion("1.3.8.1")] +[assembly: AssemblyVersion("1.3.8.2")] +[assembly: AssemblyFileVersion("1.3.8.2")]