JwtConfig.cs
1 namespace Microsoft.Bot.Connector
2 {
3  using System;
4 #if NET45
5  using System.IdentityModel.Tokens;
6 #else
7  using Microsoft.IdentityModel.Tokens;
8 #endif
9 
13  public static class JwtConfig
14  {
18  public const string ToChannelFromBotLoginUrl = "https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token";
19 
23  public const string ToChannelFromBotOAuthScope = "https://api.botframework.com/.default";
24 
28  public const string ToBotFromChannelOpenIdMetadataUrl = "https://login.botframework.com/v1/.well-known/openidconfiguration";
29 
33  public static readonly TokenValidationParameters ToBotFromChannelTokenValidationParameters =
34  new TokenValidationParameters()
35  {
36  ValidateIssuer = true,
37  ValidIssuers = new[] { "https://api.botframework.com" },
38  // Audience validation takes place in JwtTokenExtractor
39  ValidateAudience = false,
40  ValidateLifetime = true,
41  ClockSkew = TimeSpan.FromMinutes(5),
42  RequireSignedTokens = true
43  };
44 
48  public const string ToBotFromEmulatorOpenIdMetadataUrl = "https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration";
49 
53  public static readonly TokenValidationParameters ToBotFromEmulatorTokenValidationParameters =
54  new TokenValidationParameters()
55  {
56  ValidateIssuer = true,
57  ValidIssuers = new[] { "https://sts.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47/", "https://sts.windows.net/d6d49420-f39b-4df7-a1dc-d59a935871db/" },
58  // Audience validation takes place in JwtTokenExtractor
59  ValidateAudience = false,
60  ValidateLifetime = true,
61  ClockSkew = TimeSpan.FromMinutes(5),
62  RequireSignedTokens = true
63  };
64  }
65 }
Configuration for JWT tokens
Definition: JwtConfig.cs:13