locked
how to log jwt properties from azure apim? RRS feed

  • Question

  • I'm logging various context properties from APIM.  One category of properties that can be logged from the context variable is "Jwt" with properties like Algorithm, Audience, Claims.  However, when I try to log these properties from a policy, APIM returns the following error:

    'IProxyRequestContext' does not contain a definition for 'Jwt'

    I'm assuming that this is because Jwt is not configured for my particular test instance.  Is there a way to make my logging conditional for this?  Something like?:

    if Jwt exists on context then log Jwt.Algorithm

    Although Jwt is not configured for my local environment I think it may be configured for the production environment and my company would be interested in capturing this information.

    Tuesday, February 9, 2016 1:42 AM

Answers

  • Hi dornetteramb123,

    Still working on that? if you found a solution please publish here.

    Jwt is not on the context itself. You have to get Jwt token from context.Request.Headers and then used these AsJwt or TryParseJwt to return Jwt type.

    Look documentation below:

    Regards,

    Monday, March 21, 2016 3:00 PM

All replies

  • Greetings,

    Thank you for posting in here.

    I am not sure about this and I am researching more on this and will get back to you with an update. By the time I would suggest you to check the below link which might help you.

    https://msdn.microsoft.com/en-us/library/azure/dn894078.aspx#ValidateJWT

    Regards,

    Tuesday, February 9, 2016 3:25 PM
  • Hi dornetteramb123,

    Still working on that? if you found a solution please publish here.

    Jwt is not on the context itself. You have to get Jwt token from context.Request.Headers and then used these AsJwt or TryParseJwt to return Jwt type.

    Look documentation below:

    Regards,

    Monday, March 21, 2016 3:00 PM