How do your create a JWT to access MSGRAPH API with Certificate Based Authentication???

This page summarizes the projects mentioned and recommended in the original post on /r/PowerShell

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • msgraph-sdk-javascript

    Microsoft Graph client library for JavaScript

  • # Get the certificate from the certificate store $store = New-Object System.Security.Cryptography.X509Certificates.X509Store("MY", "LocalMachine") $store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadOnly) $cert = $store.Certificates | Where-Object { $_.Subject -eq "CN=your_certificate_name" } # Build the JWT assertion $header = @{alg="RS256";typ="JWT"} $payload = @{iss="your_client_id";sub="your_client_id";aud="https://graph.microsoft.com";exp=(Get-Date).AddMinutes(10).ToUnixTime()} $headerEncoded = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(($header | ConvertTo-Json))) $payloadEncoded = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(($payload | ConvertTo-Json))) $data = "{0}.{1}" -f $headerEncoded, $payloadEncoded $signature = [System.Convert]::ToBase64String($cert.GetRSAPrivateKey().SignData(([Text.Encoding]::UTF8.GetBytes($data)), "SHA256")) $jwt = "{0}.{1}.{2}" -f $headerEncoded, $payloadEncoded, $signature # Make the request to the Microsoft Graph API $response = Invoke-WebRequest -Method GET -Uri "https://graph.microsoft.com/v1.0/users?$select

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Find the length of an email attachment name.

    1 project | /r/PowerShell | 27 Jun 2023
  • Container access to containers based on azure AD groups

    2 projects | /r/Traefik | 16 May 2023
  • Filtering app names that start with

    1 project | /r/PowerShell | 4 May 2023
  • Have you worked with Microsoft Graph API?

    1 project | /r/programming | 3 May 2023
  • Need some script helping - M365 API

    1 project | /r/PowerShell | 2 Mar 2023