Skip to content

Instantly share code, notes, and snippets.

@clientbala
clientbala / CInlineProgramArgs.cs
Created May 8, 2023 19:55
CInlineProgramArgs to set the webcontainer path
using Microsoft.AspNetCore.Mvc;
using Pulumi.Automation;
using System.Reflection;
using Resources = Pulumi.AzureNative.Resources;
using Storage = Pulumi.AzureNative.Storage;
namespace PulumiOverHttpContainer.Controllers
{
public class CInlineProgramArgs : InlineProgramArgs
{
@clientbala
clientbala / PulumiOverHttpContainer.cs
Created May 8, 2023 18:58
PulumiOverHttpContainer
using Microsoft.AspNetCore.Mvc;
using Pulumi.Automation;
using System.Reflection;
using Resources = Pulumi.AzureNative.Resources;
using Storage = Pulumi.AzureNative.Storage;
namespace PulumiOverHttpContainer.Controllers
{
public class CInlineProgramArgs : InlineProgramArgs
{
@clientbala
clientbala / gist:3daf11e4034b6e5795ba27c7a5d72b18
Created February 23, 2021 15:32
CustomConnector - Graph - API - Members - Pages - Page - Swagger - 2.0
paths:
/v1.0/groups/{id}/members:
get:
responses:
default:
description: default
schema: {}
summary: group
description: member
operationId: groupmembers
@clientbala
clientbala / gist:f0f68cf8a863eef878d6653e5fb4a2f5
Created April 25, 2018 19:18
VSCode RestClient Extension
# @name getclientsidewebparts
GET https://sktechnologies.sharepoint.com/_api/web/getclientsidewebparts HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: {{$aadToken sktechnologiesltd.co.uk}}
###
# @name get user
GET https://graph.microsoft.com/v1.0/users/kshsbala@sktechnologies.onmicrosoft.com/ HTTP/1.1
var signInUserId = ClaimsPrincipal.Current.FindFirst(ClaimTypes.NameIdentifier).Value;
var userObjectId = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/objectidentifier").Value;
string TenantIdClaimType = "http://schemas.microsoft.com/identity/claims/tenantid";
string tenantId = ClaimsPrincipal.Current.FindFirst(TenantIdClaimType).Value;
string upn = HttpContext.Current.User.Identity.Name;
Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext ac = new Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext(string.Format("https://login.windows.net/{0}", tenantId));
ClientCredential cc = new ClientCredential(SettingsHelper.ClientId, SettingsHelper.AppKey);
AuthenticationResult result = ac.AcquireToken("https://graph.windows.net", cc);