I hereby claim:
- I am jpda on github.
- I am jpda (https://keybase.io/jpda) on keybase.
- I have a public key whose fingerprint is 57E2 0A64 15FC 9288 006C 0E20 1B0E B0CE C35D 3922
To claim this, I am signing this object:
| [{ | |
| "shipmentId": "1Z1234ABC", | |
| "timestamp": "2018-02-01T01:13:45Z", | |
| "status": "Left carrier facility, Seattle WA" | |
| }, | |
| { | |
| "shipmentId": "1Z1234ABC", | |
| "timestamp": "2018-02-01T16:49:17Z", | |
| "status": "Arrived carrier facility, Des Moines IA" | |
| }, |
| using System; | |
| using System.Collections.Generic; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using Stuff.Formatters; | |
| using Microsoft.ServiceBus.Messaging; | |
| namespace Stuff.Subscribers | |
| { | |
| public class EventHubSubscriber : SubscriberBase, IAsyncObserver<string> |
| using System; | |
| using System.Collections.Generic; | |
| using System.Runtime.CompilerServices; | |
| using Microsoft.ApplicationInsights; | |
| using Microsoft.ApplicationInsights.DataContracts; | |
| namespace Stuff | |
| { | |
| public class Log | |
| { |
| private static string GetUserToken() | |
| { | |
| var cid = "<application client ID>"; | |
| var targetCid = "<target resource ID - be careful here, some apps require client/resource ID (GUID), others also accept a URI"; | |
| var key = "<URL-encoded client secret key>"; | |
| var reqUri = "<authority, usually something like https://login.microsoftonline.com/<tenant ID or domain name>/oauth2/token"; | |
| var postData = $"resource={targetCid}&client_id={cid}&grant_type=password&username=user%40jpda.onmicrosoft.com&password={password}&type=openid&client_secret={key}"; | |
| // example: "resource=00000002-0000-0000-c000-000000000000&client_id=eeb7d568-2e05-45cf-87eb-d07604340af7&grant_type=password&username=user%40jpda.onmicrosoft.com&password=lol&scope=openid&client_secret=urlencodedsecretkey" |
| using System; | |
| using System.Linq; | |
| using System.Threading.Tasks; | |
| using Microsoft.Azure.ServiceBus; | |
| using Microsoft.Azure.ServiceBus.Filters; | |
| namespace ConsoleApp2 | |
| { | |
| class Program | |
| { |
I hereby claim:
To claim this, I am signing this object:
| private static readonly string ClientId = ConfigurationManager.AppSettings["ida:ClientId"]; | |
| private static readonly string AadInstance = ConfigurationManager.AppSettings["ida:AADInstance"]; | |
| private static readonly string TenantId = ConfigurationManager.AppSettings["ida:TenantId"]; | |
| private static readonly string PostLogoutRedirectUri = ConfigurationManager.AppSettings["ida:PostLogoutRedirectUri"]; | |
| private static readonly string Authority = AadInstance + TenantId; | |
| private static readonly string TargetResourceId = ConfigurationManager.AppSettings["ida:TargetResourceId"]; | |
| public void ConfigureAuth(IAppBuilder app) | |
| { | |
| app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType); | |
| app.UseCookieAuthentication(new CookieAuthenticationOptions()); |
| <?xml version="1.0" encoding="utf-8" ?> | |
| <configuration> | |
| <startup> | |
| <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> | |
| </startup> | |
| <system.serviceModel> | |
| <bindings> | |
| <basicHttpBinding> | |
| <binding name="BasicHttpBinding_IAuthService" /> | |
| </basicHttpBinding> |
| <?xml version="1.0"?> | |
| <configuration> | |
| <appSettings> | |
| <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> | |
| </appSettings> | |
| <system.web> | |
| <compilation debug="true" targetFramework="4.5" /> | |
| <httpRuntime targetFramework="4.5"/> | |
| </system.web> | |
| <system.serviceModel> |
| param ( | |
| [string][Parameter(Mandatory = $true)]$DeviceName, | |
| [string][Parameter(Mandatory = $false)]$DefaultAppName = "IotCoreDefaultApp", | |
| [string][Parameter(Mandatory = $true)]$TargetAppName, | |
| [string][Parameter(Mandatory = $true)]$TargetAppPath, | |
| [string][Parameter(Mandatory = $true)]$DeviceUsername, | |
| [string][Parameter(Mandatory = $true)]$DevicePassword | |
| ) | |
| $ErrorActionPreference = "Stop" | |
| Add-Type -Path "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Net.Http.dll" |