Skip to content

Instantly share code, notes, and snippets.

View herskinduk's full-sized avatar

Kern Herskind Nightingale herskinduk

View GitHub Profile
app.SetDefaultSignInAsAuthenticationType(WsFederationAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(
new CookieAuthenticationOptions
{
AuthenticationType =
WsFederationAuthenticationDefaults.AuthenticationType
});
app.UseWsFederationAuthentication(new WsFederationAuthenticationOptions
{
MetadataAddress = ...,
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions());
//use OpenId
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
ClientId = ...,
Authority = ...,
@herskinduk
herskinduk / ItemServiceConsoler.cs
Last active August 29, 2015 14:19
SSC Item Service server-to-server example
using System;
using System.Net;
using System.Net.Http;
using System.Text;
namespace ItemServiceConsoler
{
class Program
{
static void Main(string[] args)
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<contentSearch>
<indexConfigurations>
<!-- Un-comment out the config for Lucene or SOLR for your project -->
<defaultLuceneIndexConfiguration>
<indexDocumentPropertyMapper>
@herskinduk
herskinduk / gist:c718a70852e7bc3dcb25
Created October 30, 2014 21:24
msbuild target for generating T4 assembly directives based on project references
<Target Name="Write_AssemblyRefs_TT" BeforeTargets="TransformOnBuild">
<!-- A message for all to enjoy! -->
<WriteLinesToFile File="@(MyTextFile)"
Lines="&lt;# /* AUTOGENERATED BY MSBUILD and Kern Herskind Nightingale */ #&gt;"
Overwrite="true"
Encoding="Unicode" />
<!-- Output all assembly references with a HintPath -->
<WriteLinesToFile File="@(MyTextFile)"
Lines="&lt;#@ assembly name=&quot;$(ProjectDir)%(Reference.HintPath)&quot; #&gt;"
Overwrite="false"
@herskinduk
herskinduk / LuceneDocumentTypeMapper.cs
Created October 24, 2014 18:30
Fix for fortis lucene content search
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Fortis;
using Fortis.Model;
using Sitecore.ContentSearch;
using Sitecore.ContentSearch.Linq.Methods;
using Sitecore.ContentSearch.Security;
using Sitecore.Data;
@herskinduk
herskinduk / gist:26fb9f1cac012c3b89c4
Created October 16, 2014 20:28
Assembly mappings for SPEAK Reporting
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
</dependentAssembly>
@herskinduk
herskinduk / SkinnedSublayout.cs
Last active August 29, 2015 14:07
Resolve Active Commerce and SBOS accelerators Sublayout conflict
using ActiveCommerce.Extensions;
namespace SbosAcceleratorsPlusActiveCommerce
{
public class SkinnedSublayout : global::Sitecore.SbosAccelerators.Shared.Web.UI.WebControls.Sublayout
{
protected override void CreateChildControls()
{
if (global::Sitecore.Context.Site != null)
{
@herskinduk
herskinduk / gist:7a67839b4af39fc7ebcc
Created October 15, 2014 10:44
Assembly bindings to be added to Sitecore web.config for MVC5
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<!--<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
////////////////////////////////////
// //
// AUTO GENERATED. DO NOT EDIT. //
// //
////////////////////////////////////
using System.Collections;
using System.Collections.Generic;
using System.Linq;