This file contains hidden or 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
[HttpGet] | |
[Authorize(Policy = "Certificate")] | |
[Route("Validate")] | |
public ActionResult<IEnumerable<string>> Validate() | |
{ | |
var token = "{"; | |
foreach (var claim in User.Claims) | |
{ | |
//Datetimes are already escaped | |
if (claim.Type.ToString().Contains("time")) |
This file contains hidden or 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 void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) | |
.AddJwtBearer(options => | |
{ | |
options.MetadataAddress = "https://adfs.contoso.com/adfs/.well-known/openid-configuration"; | |
options.Validate(); | |
options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters | |
{ |
This file contains hidden or 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
[{ | |
"typ": "JWT", | |
"alg": "RS256", | |
"x5t": "..." | |
},{ | |
"aud": "urn:AppProxy:com", | |
"iss": "http://adfs.contoso.com/adfs/services/trust", | |
"iat": 1543769125, | |
"exp": 1543772725, | |
"relyingpartytrustid": "...", |
This file contains hidden or 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
[HttpGet] | |
[Route("Parse")] | |
public ActionResult<IEnumerable<string>> Parse() | |
{ | |
var token = string.Empty; | |
//The token can be passed either via query string or headers | |
if (HttpContext.Request.QueryString.Value.Contains("token")) | |
{ | |
token = HttpContext.Request.Query["token"].ToString(); |
This file contains hidden or 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; | |
using System.Security.Cryptography.X509Certificates; | |
using Microsoft.IdentityModel.Clients.ActiveDirectory; | |
namespace SignedJwt | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains hidden or 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
<div class="container"> | |
<div class="row"> | |
<hr /> | |
<div class="col"> | |
<a class="btn btn-default" href="https://login.microsoftonline.com/yourtenant.onmicrosoft.com/oauth2/v2.0/authorize? | |
p=B2C_1A_Signup_Signin_Dev&client_id=guid&nonce=defaultNonce&redirect_uri=https%3A%2F%2Fjwt.ms&scope=openid | |
&response_type=id_token&prompt=login&domain_hint=commonaad">Partner Login</a> | |
</div> | |
<div class="col"> | |
<hr/> |
This file contains hidden or 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" | |
using System; | |
using System.Net; | |
using System.Net.Http.Formatting; | |
using Newtonsoft.Json; | |
public static async Task<object> Run(HttpRequestMessage request, TraceWriter log) | |
{ | |
log.Info($"Webhook was triggered!"); |
This file contains hidden or 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
spec: | |
containers: | |
- name: myfrontend | |
image: nginx | |
volumeMounts: | |
- mountPath: "/mnt/azure" | |
name: volume | |
volumes: | |
- name: volume | |
persistentVolumeClaim: |
This file contains hidden or 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
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: azurefile | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
storageClassName: azurefile | |
resources: | |
requests: |
This file contains hidden or 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
kind: StorageClass | |
apiVersion: storage.k8s.io/v1 | |
metadata: | |
name: azurefile | |
provisioner: kubernetes.io/azure-file | |
parameters: | |
storageAccount: k8sazurefiles |