Skip to content

Instantly share code, notes, and snippets.

View SteveSyfuhs's full-sized avatar

Steve Syfuhs SteveSyfuhs

View GitHub Profile
<system.identityModel>
<identityConfiguration>
<securityTokenHandlers>
<add type="System.IdentityModel.Tokens.JwtSecurityTokenHandler, System.IdentityModel.Tokens.Jwt" />
</securityTokenHandlers>
</identityConfiguration>
<system.identityModel>
public class MySecurityTokenServiceConfiguration : SecurityTokenServiceConfiguration
{
public MySecurityTokenServiceConfiguration()
{
ImportSecurityTokenHandlers();
}
private void ImportSecurityTokenHandlers()
{
SecurityTokenHandlers.AddOrReplace(new JwtSecurityTokenHandler());
protected override Scope GetScope(ClaimsPrincipal principal, RequestSecurityToken request)
{
bool appRequiresJwt = true;
if (appRequiresJwt)
{
request.TokenType = "urn:ietf:params:oauth:token-type:jwt";
}
return WhateverYouDoToGenerateScope(principal, request);
var resp = channel.Issue(new RequestSecurityToken()
{
RequestType = RequestTypes.Issue,
TokenType = "urn:ietf:params:oauth:token-type:jwt",
AppliesTo = new EndpointReference("http://azureservices/AdminSite")
}, out rstr);
Set-MgmtSvcRelyingPartySettings -Target Admin -MetadataEndpoint
"https://sts.syfuhs.net/federationmetadata/2007-06/federationmetadata.xml" -Server localhost\sqlexpress
{
"Realm":"http://azureservices/WindowsAuthSite",
"Endpoint":"https://adminauth-cloud.syfuhs.net/wsfederation/issue",
"Certificates":[
"MIIC6...KnOXw=="
]
}
unprotect-MgmtSvcConfiguration -Namespace TenantSite
@SteveSyfuhs
SteveSyfuhs / uRAD
Created March 22, 2015 23:17
Sample data from uRAD
{
"data":{
"id":"1100007A",
"type":"1",
"detector":"SBM20",
"cpm":22,
"temperature":23.31,
"uptime":107522
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
using CertLib;
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
namespace KeyGenSigning
{
class Program
{
static void Main(string[] args)