Skip to content

Commit 13c8783

Browse files
authored
Merge branch 'dev' into bugfixes/pipelineTriggers
2 parents 852811b + 3c9ce31 commit 13c8783

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ If permission related errors occur and the user you authenticated with in the po
9494
- You can try running `Disconnect-MgGraph`, then `Connect-MgGraph`. Then, run the code that encountered the permission issues to see if it works.
9595
- You can try running `Connect-MgGraph -ForceRefresh`. This will trigger a refresh of the access token in your cache. MSAL will only refresh the access token in your cache if it has expired (usually an hour), or if you explicitly refresh it via `-ForceRefresh`. Then, run the code that encountered the permission issues to see if it works.
9696

97+
## Known Issues
98+
- If you attempt to run `Connect-Graph` from the PowerShell ISE (integrated scripting environment) the command fails with an error "Device code terminal timed-out after {X} seconds". This is a known issue and it is recommended to use a PowerShell host other than the ISE.
99+
97100
## Issues
98101
If you find any bugs when using the Microsoft Graph PowerShell modules, please file an issue in our GitHub issues page.
99102

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System;
2+
using System.Collections;
3+
using System.Collections.Generic;
4+
using System.Text;
5+
6+
using Microsoft.Graph.PowerShell.Authentication.Helpers;
7+
8+
using Xunit;
9+
10+
namespace Microsoft.Graph.Authentication.Test.Helpers
11+
{
12+
public class StringUtilTests
13+
{
14+
private const string TestJsonArray = "{\"@odata.context\": \"https://graph.microsoft.com/v1.0/$metadata#users\"," + "\"value\": [{\"id\": \"6e7b768e-07e2-4810-8459-485f84f8f204\"},{\"id\": \"87d349ed-44d7-43e1-9a83-5f2406dee5bd\"}]}";
15+
16+
private const string TestJsonObject = "{\"@odata.context\": \"https://graph.microsoft.com/v1.0/$metadata#users/$entity\",\"businessPhones\": [\"+1 412 555 0109\"],\"displayName\": \"Megan Bowen\",\"givenName\": \"Megan\",\"jobTitle\": \"Auditor\",\"mail\": \"[email protected]\", \"mobilePhone\": null, \"officeLocation\": \"12/1110\",\"preferredLanguage\": \"en-US\",\"surname\": \"Bowen\",\"userPrincipalName\": \"[email protected]\",\"id\": \"48d31887-5fad-4d73-a9f5-3c356e68a038\"}";
17+
18+
[Theory]
19+
[MemberData(nameof(TestJsonData))]
20+
public void ShouldReturnCaseInsensitiveDictionaries(string jsonString)
21+
{
22+
Exception ex = null;
23+
var converted = jsonString.TryConvertToJson(out var jsonObj, ref ex);
24+
25+
Assert.True(converted);
26+
Assert.IsType<Hashtable>(jsonObj);
27+
var jsonHashTable = (Hashtable)jsonObj;
28+
Assert.Equal(jsonHashTable["Value"], jsonHashTable["value"]);
29+
}
30+
public static IEnumerable<object[]> TestJsonData =>
31+
new List<object[]>
32+
{
33+
new object[] { TestJsonArray},
34+
new object[] { TestJsonObject}
35+
};
36+
}
37+
}

src/Authentication/Authentication/Helpers/StringUtil.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ private static ICollection<object> PopulateHashTableFromJArray(JArray list, out
197197
private static Hashtable PopulateHashTableFromJDictionary(JObject entries, out Exception exception)
198198
{
199199
exception = null;
200-
Hashtable result = new Hashtable(entries.Count);
200+
Hashtable result = new Hashtable(entries.Count, StringComparer.OrdinalIgnoreCase);
201201
foreach (var entry in entries)
202202
{
203203
// Case sensitive duplicates should normally not occur since JsonConvert.DeserializeObject

0 commit comments

Comments
 (0)