Skip to content

Commit bc13280

Browse files
Merge pull request #316 from sujitharamadass/MayRelease
Changing validateIDToken logic to include 2048 key signing
2 parents d935816 + 042e71d commit bc13280

File tree

5 files changed

+24
-19
lines changed

5 files changed

+24
-19
lines changed

IPPDotNetDevKitCSV3/Code/Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<PackageIcon>$(MSBuildThisFileDirectory)logo.png</PackageIcon>
1515
<OutputPath>$(SolutionDir)artifacts\bin</OutputPath>
1616
<Copyright>Copyright © 2020 Intuit, Inc.</Copyright>
17-
<AssemblyVersion>14.6.3.5</AssemblyVersion>
18-
<FileVersion>14.6.3.4</FileVersion>
17+
<AssemblyVersion>14.6.3.6</AssemblyVersion>
18+
<FileVersion>14.6.3.6</FileVersion>
1919
<Company>Intuit</Company>
2020
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
2121
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>

IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Nupkg/Intuit.Ipp.Nupkg.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<PackageId>IppDotNetSdkForQuickBooksApiV3</PackageId>
1010
<AssemblyName>IppDotNetSdkForQuickBooksApiV3</AssemblyName>
1111
<DocumentationFile>$(BaseOutputPath)$(AssemblyName).xml</DocumentationFile>
12-
<MainVersion>14.6.3.5</MainVersion>
12+
<MainVersion>14.6.3.6</MainVersion>
1313
<PackageVersionSuffix>pre</PackageVersionSuffix>
1414
<Version>$(MainVersion)-$(PackageVersionSuffix)</Version>
1515
<Version>$(MainVersion)</Version>

IPPDotNetDevKitCSV3/Code/Intuit.Ipp.OAuth2PlatformClient/Client/OAuth2Client.cs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -875,29 +875,19 @@ public Task<bool> ValidateIDTokenAsync(String idToken)
875875
IList<JsonWebKey> keys = DiscoveryDoc.KeySet.Keys;
876876
string mod = "";
877877
string exponent = "";
878+
string keyIdFromHeader = null;
878879
if (keys != null)
879880
{
880-
foreach (var key in keys)
881-
{
882-
if (key.N != null)
883-
{
884-
mod = key.N;
885-
}
886-
if (key.N != null)
887-
{
888-
exponent = key.E;
889-
}
890-
}
891-
892881
if (idToken != null)
893882
{
894883
string[] splitValues = idToken.Split('.');
895884
if (splitValues[0] != null)
896885
{
897886
var headerJson = Encoding.UTF8.GetString(Base64Url.Decode(splitValues[0].ToString()));
898887
IdTokenHeader headerData = JsonConvert.DeserializeObject<IdTokenHeader>(headerJson);
888+
keyIdFromHeader = headerData.Kid;
899889

900-
if (headerData.Kid == null)
890+
if (keyIdFromHeader == null)
901891
{
902892
return Task.FromResult(false);
903893
}
@@ -965,6 +955,21 @@ public Task<bool> ValidateIDTokenAsync(String idToken)
965955
}
966956
}
967957

958+
foreach (var key in keys)
959+
{
960+
if(keyIdFromHeader == key.Kid)
961+
{
962+
if (key.N != null)
963+
{
964+
mod = key.N;
965+
}
966+
if (key.N != null)
967+
{
968+
exponent = key.E;
969+
}
970+
}
971+
}
972+
968973
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
969974
rsa.ImportParameters(
970975
new RSAParameters()

IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Utility/Common/CoreConstants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public static class CoreConstants
250250
/// <summary>
251251
/// The Request source header value.
252252
/// </summary>
253-
public const string REQUESTSOURCEHEADER = "V3DotNetSDK14.6.3.5";
253+
public const string REQUESTSOURCEHEADER = "V3DotNetSDK14.6.3.6";
254254

255255
/// <summary>
256256
/// multipart/form-data format

IPPDotNetDevKitCSV3/Tools/XsdExtension/Intuit.Ipp.Data/Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<PackageOutputPath>$(SolutionDir)artifacts\nupkg</PackageOutputPath>
1414
<OutputPath>$(SolutionDir)artifacts\bin</OutputPath>
1515
<Copyright>Copyright © 2020 Intuit, Inc.</Copyright>
16-
<AssemblyVersion>14.6.3.4</AssemblyVersion>
17-
<FileVersion>14.6.3.4</FileVersion>
16+
<AssemblyVersion>14.6.3.6</AssemblyVersion>
17+
<FileVersion>14.6.3.6</FileVersion>
1818
<Company>Intuit</Company>
1919
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
2020
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>

0 commit comments

Comments
 (0)