This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sitecore.Owin.Authentication.Configuration; | |
using Sitecore.Owin.Authentication.Identity; | |
using Sitecore.Owin.Authentication.Services; | |
using System; | |
using Microsoft.AspNet.Identity.Owin; | |
namespace Foundation.Authentication | |
{ | |
public class CreateUniqueUser : DefaultExternalUserBuilder | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/"> | |
<sitecore role:require="Standalone or ContentDelivery or ContentManagement"> | |
<!-- Enables Federated Auth --> | |
<settings> | |
<setting name="FederatedAuthentication.Enabled"> | |
<patch:attribute name="value">true</patch:attribute> | |
</setting> | |
</settings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
using System.Security.Claims; | |
using System.Threading.Tasks; | |
using Microsoft.IdentityModel.Protocols; | |
using Microsoft.Owin.Security; | |
using Microsoft.Owin.Security.Notifications; | |
using Microsoft.Owin.Security.OpenIdConnect; | |
using Owin; | |
using Sitecore.Owin.Authentication.Configuration; | |
using Sitecore.Owin.Authentication.Pipelines.IdentityProviders; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using Sitecore.Rules; | |
using Sitecore.Rules.Conditions; | |
using Sitecore.Data.Items; | |
using Sitecore.Analytics; | |
using Karbyn.SC.Core.Extensions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// Updates the datasource for a rendering from an item path to using the | |
/// Sitecore ID for the item. The benefit is that this will allow datasources | |
/// to be able to be freely moved from one area of the content tree to another | |
/// while enabling the rendering to still function as expected. | |
/// | |
///The Sitecore.Data.Items.Item to update the datasources for. | |
public void UpdateDataSourcePathToId(Sitecore.Data.Items.Item itemToProcess) | |
{ | |
if (null != itemToProcess) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace StrategyPattern.Contracts | |
{ | |
public interface IDiscountStrategy | |
{ | |
decimal ApplyDiscount(decimal price); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override void OnException(HttpActionExecutedContext actionExecutedContext) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class APIKeyHandler : DelegatingHandler | |
{ | |
private const string REQUEST_HEADER = "X-KARBYN-APIKEY"; | |
protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) | |
{ | |
bool isValidAPIKey = false; | |
//Validate that the api key exists, and if so, validate | |
if (request.Headers.Contains(REQUEST_HEADER)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Color | |
{ | |
public double Red { get; set; } | |
public double Green { get; set; } | |
public double Blue { get; set; } | |
public Color() | |
{ } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IQueryable<CustomerPurchases> GetPurchases(int customerID) | |
{ | |
return _purchaseService.GetPurchases(customerID); | |
} |
NewerOlder