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
param keyVaultName string | |
param location string = resourceGroup().location | |
param tenantId string = subscription().tenantId | |
param adminUserObjectIds array | |
param applicationUserObjectIds array | |
var adminAccessPolicies = [for adminUser in adminUserObjectIds: { | |
objectId: adminUser | |
tenantId: tenantId | |
permissions: { |
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
$(document).ready(function() { | |
$("#ajaxLink").click(function (event) { | |
event.preventDefault(); | |
$.get("/Home/GetData").error(function(jqxhr) { | |
var errorObject = JSON.parse(jqxhr.responseText); | |
$("#errorMessage").text(errorObject.message); | |
}); | |
}); | |
}); |
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
protected void Application_Error(object sender, EventArgs e) | |
{ | |
Exception lastError = Server.GetLastError(); | |
Server.ClearError(); | |
int statusCode = 0; | |
if (lastError.GetType() == typeof(HttpException)) | |
{ | |
statusCode = ((HttpException) lastError).GetHttpCode(); |
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.Web.Mvc; | |
using ThirteenDaysAWeek.Mvc4CustomErrorPage.Web.Models; | |
namespace ThirteenDaysAWeek.Mvc4CustomErrorPage.Web.Controllers | |
{ | |
public class ErrorController : Controller | |
{ | |
public ActionResult Index(int statusCode, Exception exception, bool isAjaxRequet) | |
{ |
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.Threading.Tasks; | |
using Microsoft.WindowsAzure.MobileServices; | |
using ThirteenDaysAWeek.AzureCustomAuth.Handlers; | |
using ThirteenDaysAWeek.AzureCustomAuth.Factories; | |
using ThirteenDaysAWeek.AzureCustomAuth.Models; | |
namespace ThirteenDaysAWeek.AzureCustomAuth.Services | |
{ | |
public class TestDataService |
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.Net.Http; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using ThirteenDaysAWeek.AzureCustomAuth.Services; | |
namespace ThirteenDaysAWeek.AzureCustomAuth.Handlers | |
{ | |
public class ZumoAuthHeaderHandler : DelegatingHandler | |
{ |
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.Threading.Tasks; | |
using Microsoft.WindowsAzure.MobileServices; | |
using ThirteenDaysAWeek.AzureCustomAuth.Models; | |
using ThirteenDaysAWeek.AzureCustomAuth.Handlers; | |
using ThirteenDaysAWeek.AzureCustomAuth.Factories; | |
namespace ThirteenDaysAWeek.AzureCustomAuth.Services | |
{ |
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.Net.Http; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Newtonsoft.Json.Linq; | |
using ThirteenDaysAWeek.AzureCustomAuth.Services; | |
namespace ThirteenDaysAWeek.AzureCustomAuth.Handlers | |
{ | |
public class AuthenticationHandler : DelegatingHandler | |
{ |
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 async Task DoInsert() | |
{ | |
using (MobileServiceClient client = new MobileServiceClient(URL, KEY)) | |
{ | |
var table = client.GetTable<EntityType>(); | |
var entity = new EntityType(); | |
await table.InsertAsync(entity); | |
} | |
} |
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
// Thanks to Chris Risner for his blog post, http://chrisrisner.com/Authentication-with-Windows-Azure-Mobile-Services | |
// This script comes from his post, with a couple of minor modifications | |
var crypto = require('crypto'); | |
var iterations = 1000; | |
var bytes = 32; | |
var aud = "Custom"; | |
var masterKey = "wkeHEoWUaPJSHsSOcWgmVLOZbIpeeg92"; | |
function insert(item, user, request) { | |
console.log("Executing insert script on accounts table"); |
NewerOlder