Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. TokenValidationParameters validationParams = new TokenValidationParameters
  2. {
  3. // We accept both the App Id URI and the AppId of this service application
  4. ValidAudiences = new[] { kADConfiguration_.Audience, kADConfiguration_.ClientId },
  5.  
  6. // Supports both the Azure AD V1 and V2 endpoint
  7. ValidIssuers = new[] { _issuer, $"{_issuer}/v2.0" },
  8. ValidateIssuer = true, // set to false and works, set to true it fails
  9.  
  10. IssuerSigningKeys = validationInfo.Item2
  11. };
  12. Microsoft.IdentityModel.Tokens.SecurityToken v;
  13. System.Security.Claims.ClaimsPrincipal answer = handler.ValidateToken(authorizationHeader.Substring(kBearer_.Length), validationParams, out v);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement