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 ActionResult Stats() | |
{ | |
var authorizationEndpoint = "https://login.windows.net/"; | |
var resource = "https://graph.windows.net"; | |
//Change port number to whatever your Visual Studio has chosen for you | |
var redirectURI = "https://localhost:44300/Home/CatchCode"; | |
string authorizationUrl = string.Format("{0}{1}/oauth2/authorize?&response_type=code&client_id={2}&resource={3}&redirect_uri={4}", | |
authorizationEndpoint, | |
ClaimsPrincipal.Current.FindFirst(TenantIdClaimType).Value, |
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 CustomOffice365OWA.Models; | |
using System; | |
using System.Globalization; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
using System.Web.Mvc; | |
namespace CustomOffice365OWA.Controllers | |
{ | |
[RoutePrefix("Mail")] |
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 Microsoft.IdentityModel.Clients.ActiveDirectory; | |
using Newtonsoft.Json; | |
using System; | |
using System.Configuration; | |
using System.Globalization; | |
using System.Net.Http; | |
using System.Security.Claims; | |
using System.Threading.Tasks; | |
using System.Web; | |
using System.Web.Mvc; |
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 Newtonsoft.Json; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
namespace DirectoryExtensionsApp.Models | |
{ | |
public class UserContext | |
{ | |
[JsonProperty("odata.metadata")] | |
public string userContext { get; set; } |
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
#r "Newtonsoft.Json" | |
#r "System.Configuration" | |
#r "Microsoft.IdentityModel.Clients.ActiveDirectory.dll" | |
using System.Net; | |
using System.Configuration; | |
using System.Security.Claims; | |
using System.Net.Http.Headers; | |
using Newtonsoft.Json; | |
using Microsoft.IdentityModel.Clients.ActiveDirectory; |
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
#r "Newtonsoft.Json" | |
#r "Microsoft.Rest.ClientRuntime.dll" | |
#r "Microsoft.Bot.Connector.Utilities.dll" | |
#r "Microsoft.Bot.Connector.dll" | |
using System.Net; | |
using Microsoft.Bot.Connector; | |
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) | |
{ | |
log.Verbose($"C# HTTP trigger function processed a request. RequestUri={req.RequestUri}"); |
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
#r "EAS Protocol.dll" | |
#r "System.Xml.Linq.dll" | |
using System; | |
using System.Net.Http.Headers; | |
using System.Xml.Linq; | |
using EAS_Protocol.WBXML; | |
public static void Run(TimerInfo myTimer,out string statuscode, out string responseBlob, TraceWriter log) | |
{ | |
log.Info($"C# Timer trigger function executed at: {DateTime.Now}"); |
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; | |
public static void Run(string myQueueItem, out object statusDocument, TraceWriter log) | |
{ | |
log.Info($"C# Queue trigger function processed: {myQueueItem}"); | |
var status = myQueueItem.Split(';'); | |
log.Info($"Guid: {status[0]}, StatusCode: {status[1]}"); | |
var guid = status[0]; | |
var resCode = status[1]; | |
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
#r "EAS Protocol.dll" | |
#r "System.Xml.Linq.dll" | |
using System; | |
using System.Xml.Linq; | |
using EAS_Protocol.WBXML; | |
public static void Run(string myBlob, TraceWriter log) | |
{ | |
log.Info($"C# Blob trigger function processed: {myBlob}"); | |
var response = myBlob.Split(';'); |
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
//Assume the input is in a control called txtJwtIn, | |
//and the output will be placed in a control called txtJwtOut | |
var jwtHandler = new JwtSecurityTokenHandler(); | |
var jwtInput = txtJwtIn.Text; | |
//Check if readable token (string is in a JWT format) | |
var readableToken = jwtHandler.CanReadToken(jwtInput); | |
if(readableToken != true) | |
{ |
OlderNewer