Skip to content

Commit

Permalink
created multi configuration build for all kentico versions
Browse files Browse the repository at this point in the history
  • Loading branch information
cleftheris committed Jan 9, 2023
1 parent f1df1ae commit 72e859f
Show file tree
Hide file tree
Showing 11 changed files with 133 additions and 60 deletions.
47 changes: 45 additions & 2 deletions Indice.Kentico.Oidc.sln
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29728.190
# Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{BE5421C9-FDA2-484C-89BD-F092CAAB3A08}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
src\Directory.Build.targets = src\Directory.Build.targets
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Indice.Kentico.Oidc", "src\Indice.Kentico.Oidc\Indice.Kentico.Oidc.csproj", "{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{11743D9E-7320-4A0D-88E0-F33A709022EE}"
ProjectSection(SolutionItems) = preProject
pack.ps1 = pack.ps1
README.md = README.md
EndProjectSection
EndProject
Expand All @@ -26,21 +31,59 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Kentico11|Any CPU = Kentico11|Any CPU
Kentico11|x86 = Kentico11|x86
Kentico9|Any CPU = Kentico9|Any CPU
Kentico9|x86 = Kentico9|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Debug|x86.ActiveCfg = Debug|Any CPU
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Debug|x86.Build.0 = Debug|Any CPU
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Kentico11|Any CPU.ActiveCfg = Kentico11|Any CPU
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Kentico11|Any CPU.Build.0 = Kentico11|Any CPU
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Kentico11|x86.ActiveCfg = Kentico11|Any CPU
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Kentico11|x86.Build.0 = Kentico11|Any CPU
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Kentico9|Any CPU.ActiveCfg = Debug|Any CPU
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Kentico9|Any CPU.Build.0 = Debug|Any CPU
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Kentico9|x86.ActiveCfg = Kentico6|Any CPU
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Kentico9|x86.Build.0 = Kentico6|Any CPU
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Release|Any CPU.Build.0 = Release|Any CPU
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Release|x86.ActiveCfg = Release|Any CPU
{3CC29A69-D9DE-4BEE-AEAB-8931E1537DB0}.Release|x86.Build.0 = Release|Any CPU
{918FAD7D-1E60-4920-99AC-A6071E4824EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{918FAD7D-1E60-4920-99AC-A6071E4824EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{918FAD7D-1E60-4920-99AC-A6071E4824EC}.Debug|x86.ActiveCfg = Debug|Any CPU
{918FAD7D-1E60-4920-99AC-A6071E4824EC}.Debug|x86.Build.0 = Debug|Any CPU
{918FAD7D-1E60-4920-99AC-A6071E4824EC}.Kentico11|Any CPU.ActiveCfg = Release|Any CPU
{918FAD7D-1E60-4920-99AC-A6071E4824EC}.Kentico11|x86.ActiveCfg = Release|Any CPU
{918FAD7D-1E60-4920-99AC-A6071E4824EC}.Kentico9|Any CPU.ActiveCfg = Release|Any CPU
{918FAD7D-1E60-4920-99AC-A6071E4824EC}.Kentico9|x86.ActiveCfg = Release|Any CPU
{918FAD7D-1E60-4920-99AC-A6071E4824EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{918FAD7D-1E60-4920-99AC-A6071E4824EC}.Release|Any CPU.Build.0 = Release|Any CPU
{918FAD7D-1E60-4920-99AC-A6071E4824EC}.Release|x86.ActiveCfg = Release|Any CPU
{918FAD7D-1E60-4920-99AC-A6071E4824EC}.Release|x86.Build.0 = Release|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Debug|x86.ActiveCfg = Debug|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Debug|x86.Build.0 = Debug|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Kentico11|Any CPU.ActiveCfg = Kentico11|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Kentico11|Any CPU.Build.0 = Kentico11|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Kentico11|x86.ActiveCfg = Kentico11|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Kentico11|x86.Build.0 = Kentico11|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Kentico9|Any CPU.ActiveCfg = Kentico6|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Kentico9|Any CPU.Build.0 = Kentico6|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Kentico9|x86.ActiveCfg = Kentico6|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Kentico9|x86.Build.0 = Kentico6|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Release|Any CPU.Build.0 = Release|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Release|x86.ActiveCfg = Release|Any CPU
{9DF46905-193C-4105-99BD-D8C95D7857CD}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Binary file modified icon/icon-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icon/icon-310.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icon/icon-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions pack.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

# Clean and build in release
dotnet restore /nowarn:netsdk1138
dotnet clean

# Create all NuGet packages

dotnet pack src/Indice.Kentico.Oidc/Indice.Kentico.Oidc.csproj -c Release -p:KenticoVersion=9 -o ./artifacts
dotnet pack src/Indice.Kentico.Oidc/Indice.Kentico.Oidc.csproj -c Release -p:KenticoVersion=11 -o ./artifacts
dotnet pack src/Indice.Kentico.Oidc/Indice.Kentico.Oidc.csproj -c Release -p:KenticoVersion=12 -o ./artifacts
13 changes: 13 additions & 0 deletions samples/Indice.Web.Sample/Indice.Web.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,19 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Kentico11|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Kentico6|AnyCPU'">
<OutputPath>bin\</OutputPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
Expand Down
30 changes: 30 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project>
<PropertyGroup Label="Assembly Common">
<Copyright>Copyright (c) 2018 Indice</Copyright>
<TargetFrameworks>net47</TargetFrameworks>
<Authors>Constantinos Leftheris, Georgios Manoltzas</Authors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>Latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<KenticoVersion>12</KenticoVersion>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>
<PropertyGroup Label="Package Common">
<PackageReleaseNotes></PackageReleaseNotes>
<PackageTags></PackageTags>
<IsPackable>true</IsPackable>
<PackageIcon>icon-310.png</PackageIcon>
<PackageProjectUrl>https://github.com/indice-co/Indice.AspNet</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/indice-co/Indice.AspNet</RepositoryUrl>
<Company>Indice</Company>
<!--<GeneratePackageOnBuild>true</GeneratePackageOnBuild>-->
<!-- including PDB files in NuGet for source link because symbolsource.org does not support portable PDBs -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
</Project>
8 changes: 8 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<ItemGroup>
<None Include="..\..\icon\icon-310.png" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>
</Project>
25 changes: 14 additions & 11 deletions src/Indice.Kentico.Oidc/Handlers/SignInOidcHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,11 @@ public void ProcessRequest(HttpContext context) {
.GetResult();

//LOGGING//
StreamWriter sw5 = new StreamWriter("c:\\docs\\logfile1.txt", append: true);
sw5.WriteLine("The token response is: " + tokenResponse.Json);
sw5.WriteLine("The endpoint is: " + userInfoEndpoint);
sw5.WriteLine("The error is: " + userInfoResponse.Error);
sw5.WriteLine("The raw is: " + userInfoResponse.Raw);
sw5.Close();
System.Diagnostics.Debug.WriteLine("The token response is: " + tokenResponse.Json);
System.Diagnostics.Debug.WriteLine("The token response is: " + tokenResponse.Json);
System.Diagnostics.Debug.WriteLine("The endpoint is: " + userInfoEndpoint);
System.Diagnostics.Debug.WriteLine("The error is: " + userInfoResponse.Error);
System.Diagnostics.Debug.WriteLine("The raw is: " + userInfoResponse.Raw);
//END LOGGING//

if (userInfoResponse.IsError) {
Expand Down Expand Up @@ -125,7 +124,11 @@ public void ProcessRequest(HttpContext context) {
FullName = $"{firstName} {lastName}",
IsExternal = true,
LastName = lastName,
#if Kentico9
IsGlobalAdministrator = isAdmin,
#else
SiteIndependentPrivilegeLevel = isAdmin ? UserPrivilegeLevelEnum.GlobalAdmin : UserPrivilegeLevelEnum.None,
#endif
UserCreated = DateTime.UtcNow,
UserName = userName,
UserIsDomain = true
Expand All @@ -142,7 +145,11 @@ public void ProcessRequest(HttpContext context) {
} else {
// Update existing user's privilege level to reflect a possible change made on IdentityServer.
if (isAdmin) {
#if Kentico9
userInfo.IsGlobalAdministrator = true;
#else
userInfo.SiteIndependentPrivilegeLevel = UserPrivilegeLevelEnum.GlobalAdmin;
#endif
}
userInfo.UserIsDomain = true;
var userCurrentSite = UserSiteInfoProvider.GetUserSiteInfo(userInfo.UserID, SiteContext.CurrentSiteID);
Expand Down Expand Up @@ -182,11 +189,7 @@ public void ProcessRequest(HttpContext context) {
returnUrl = OAuthConfiguration.Host;
}
}
//LOGGING//
StreamWriter sw6 = new StreamWriter("c:\\docs\\logfile1.txt", append: true);
sw6.WriteLine("The URL is: " + returnUrl);
sw6.Close();
//END LOGGING//
System.Diagnostics.Debug.WriteLine("The URL is: " + returnUrl);

// Redirect to the requested page.
context.Response.Redirect(returnUrl);
Expand Down
35 changes: 11 additions & 24 deletions src/Indice.Kentico.Oidc/Indice.Kentico.Oidc.csproj
Original file line number Diff line number Diff line change
@@ -1,37 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<AssemblyName>Indice.Kentico.Oidc</AssemblyName>
<AssemblyTitle>Indice.Kentico.Oidc</AssemblyTitle>
<Description>ASP.NET Authentication Module for Kentico and OpenID Connect.</Description>
<Copyright>Copyright © 2020</Copyright>
<Authors>c.leftheris, g.manoltzas</Authors>
<VersionPrefix>12.0.5</VersionPrefix>
<VersionPrefix>$(KenticoVersion).0.8</VersionPrefix>
</PropertyGroup>
<PropertyGroup Label="Package">
<PackageId>Indice.Kentico.Oidc</PackageId>
<PackageTags>kentico;AspNet;oidc;</PackageTags>
<PackageReleaseNotes>Changes for integration with AWS Cognito.</PackageReleaseNotes>
<PackageIcon>icon-128.png</PackageIcon>
<PackageProjectUrl>https://github.com/indice-co/Indice.Kentico</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/indice-co/Indice.Kentico</RepositoryUrl>
<Company>Indice</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PropertyGroup>
<DefineConstants Condition="$(KenticoVersion) == '9'">Kentico9</DefineConstants>
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon\icon-128.png" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="IdentityModel" Version="3.10.6" />
</ItemGroup>
<ItemGroup Condition="$(KenticoVersion) == '9'">
<PackageReference Include="Kentico.Libraries" Version="9.0.0" />
</ItemGroup>
<ItemGroup Condition="$(KenticoVersion) == '11'">
<PackageReference Include="Kentico.Libraries" Version="11.0.0" />
</ItemGroup>
<ItemGroup Condition="$(KenticoVersion) != '11' and $(KenticoVersion) != '9'">
<PackageReference Include="Kentico.Libraries" Version="12.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Web" />
<Reference Include="System.Configuration" />
</ItemGroup>
<!--<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="start XCOPY /Y /R &quot;$(TargetDir)$(TargetName).*&quot; &quot;$(SolutionDir)..\Groupama.Cms\CMS\Bin&quot;" />
</Target>-->
</Project>
24 changes: 1 addition & 23 deletions src/Indice.Kentico/Indice.Kentico.csproj
Original file line number Diff line number Diff line change
@@ -1,32 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<AssemblyName>Indice.Kentico</AssemblyName>
<AssemblyTitle>Indice.Kentico</AssemblyTitle>
<Description>Kentico extensions, utils and helpers</Description>
<Copyright>Copyright © 2020</Copyright>
<Authors>c.leftheris, g.manoltzas</Authors>
<VersionPrefix>11.0.14</VersionPrefix>
<LangVersion>Latest</LangVersion>
</PropertyGroup>
<PropertyGroup Label="Package">
<PackageId>Indice.Kentico</PackageId>
<PackageTags>kentico;AspNet;</PackageTags>
<PackageReleaseNotes>Adds finalization of auth request.</PackageReleaseNotes>
<PackageIcon>icon-128.png</PackageIcon>
<PackageProjectUrl>https://github.com/indice-co/Indice.Kentico</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/indice-co/Indice.Kentico</RepositoryUrl>
<Company>Indice</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon\icon-128.png" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Web" />
Expand Down

0 comments on commit 72e859f

Please sign in to comment.