Skip to content

Instantly share code, notes, and snippets.

Joe Bloggs nzpcmad

  • NZ
Block or report user

Report or block nzpcmad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nzpcmad
nzpcmad / Trace.xml
Created Jul 5, 2018
Add System.Net trace
View Trace.xml
<configuration>
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.Net">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
<source name="System.Net.HttpListener">
@nzpcmad
nzpcmad / Playground.js
Last active Jun 20, 2018
Auth0 playground
View Playground.js
In the box at the top:
//cdn.auth0.com/js/lock/10.13.0/lock.min.js
Code follows:
var domain = 'xxx.auth0.com';
var clientID = '1gB0...wB7FjSa5P';
var options = {
@nzpcmad
nzpcmad / PasswordReset.xml
Last active Aug 31, 2017
Azure AD B2C custom policies with Azure AD
View PasswordReset.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TrustFrameworkPolicy
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
PolicySchemaVersion="0.3.0.0"
TenantId="my-b2c.onmicrosoft.com"
PolicyId="B2C_1A_PasswordReset"
PublicPolicyUri="http://my-b2c.onmicrosoft.com/B2C_1A_PasswordReset">
@nzpcmad
nzpcmad / Form.cs
Created Apr 5, 2017
C# code to send email
View Form.cs
private void button1_Click(object sender, EventArgs e)
{
System.Net.Mail.MailMessage mailMessage = new System.Net.Mail.MailMessage();
try
{
mailMessage.From = new System.Net.Mail.MailAddress("me@help.com", "me@Sender.com");
mailMessage.To.Add("my-email");
mailMessage.Subject = "Hullo";
mailMessage.Body = "This is a test";
mailMessage.IsBodyHtml = true;
@nzpcmad
nzpcmad / CAS.cs
Created Mar 21, 2017
ADFS custom attribute store with multiple values
View CAS.cs
using Microsoft.IdentityServer.ClaimsPolicy.Engine.AttributeStore;
using System;
using System.Collections.Generic;
using System.IdentityModel;
namespace CAStore
{
public class CAS : IAttributeStore
{
public IAsyncResult BeginExecuteQuery(string query, string[] parameters, AsyncCallback callback, object state)
View Maths WebAPI.postman_collection.json
{
"variables": [],
"info": {
"name": "Maths WebAPI",
"_postman_id": "47568f67-6685-f39a-8d7f-2cd76a9b281a",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
@nzpcmad
nzpcmad / web.config
Created Jan 13, 2017
Classic ASP and ADFS
View web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<configSections>
<section name="microsoft.identityModel" type="Microsoft.IdentityModel.Configuration.MicrosoftIdentityModelSection, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</configSections>
<location path="FederationMetadata">
<system.web>
<authorization>
<allow users="*" />
</authorization>
@nzpcmad
nzpcmad / AssignOAuth2SecurityRequirements.cs
Last active Jun 27, 2017
Using Swagger for Implicit Grant on Azure AD
View AssignOAuth2SecurityRequirements.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Swashbuckle;
using Swashbuckle.Swagger;
using System.Web.Http.Description;
namespace TodoListService
@nzpcmad
nzpcmad / AssignOAuth2SecurityRequirements.cs
Last active Dec 11, 2016
Using Swagger for Implicit Grant on ADFS 4.0
View AssignOAuth2SecurityRequirements.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Swashbuckle;
using Swashbuckle.Swagger;
using System.Web.Http.Description;
namespace TodoListService
View ADFS%20Public%20-%20Implicit%20-%20ADFS%204.0%20Release.postman_collection.json
{
"variables": [],
"info": {
"name": "ADFS Public - Implicit - ADFS 4.0 Release",
"_postman_id": "44d70984-95c6-375e-af63-ff5bd98e8238",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
You can’t perform that action at this time.