Skip to content

Instantly share code, notes, and snippets.

@nzpcmad
nzpcmad / ADFS.postman_collection - Public.json
Last active June 27, 2022 23:03
Postman collection to get userinfo via ADFS 4.0 and OpenID Connect / OAuth 2.0
{
"variables": [],
"info": {
"name": "ADFS Public",
"_postman_id": "3d8a90ce-eb38-fedf-8bfe-b75578dd0810",
"description": "Auth code flow.",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
@nzpcmad
nzpcmad / Azure%20AD.postman_collection - Public.json
Created August 24, 2016 01:52
Postman collection to get userinfo via Azure AD and OpenID Connect / OAuth 2.0
{
"variables": [],
"info": {
"name": "Azure AD Public",
"_postman_id": "d557d80b-e1a8-2922-ed57-bf7768032434",
"description": "Auth code flow.",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
@nzpcmad
nzpcmad / gist:66b2da0aa7bbdb61650ed6930b943413
Last active June 8, 2021 18:53
Postman : Resource Owner Password Grant on Server 2016 - ADFS 4.0
{
"variables": [],
"info": {
"name": "ADFS Public Resource Owner",
"_postman_id": "7dd4d5e3-fa83-6977-5b71-5571e8fce9f6",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
@nzpcmad
nzpcmad / web.config
Created January 13, 2017 00:18
Classic ASP and ADFS
<?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 / ADFS Public.postman_collection_confidential.json
Created September 1, 2016 20:35
Postman collection for confidential cleint via ADFS 4.0 and OpenID Connect / OAuth 2.0
{
"variables": [],
"info": {
"name": "ADFS Public - Confidential",
"_postman_id": "4c0d0604-58e6-35b6-50bc-51c69d779f39",
"description": "Confidential code flow.",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
@nzpcmad
nzpcmad / CAS.cs
Created March 21, 2017 18:36
ADFS custom attribute store with multiple values
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)
@nzpcmad
nzpcmad / ws-fed-auth0.js
Created February 17, 2016 01:12
Node.js with Express SSL, WS-Fed and ADFS
// http://collectivegarbage.azurewebsites.net/use-thinktecture-identity-server-v2-to-authenticate-your-node-application/
var express = require('express'),
app = express(),
bodyParser = require('body-parser'),
cookieParser = require('cookie-parser'),
session = require('express-session'),
passport = require('passport'),
wsfedsaml2 = require('passport-wsfed-saml2').Strategy;
@nzpcmad
nzpcmad / Contact.cshtml
Created April 21, 2016 01:54
Displaying claims in an ASP.NET MVC application
@*Replace existing code with ...*@
@{
ViewBag.Title = "User Claims";
}
<h2>Welcome: @ViewBag.ClaimsIdentity.Name</h2>
<h3>Values from Identity</h3>
<table>
<tr>
@nzpcmad
nzpcmad / Trace.xml
Created July 5, 2018 19:23
Add System.Net trace
<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 June 20, 2018 03:45
Auth0 playground
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 = {