def _check_audience(payload_dict, audience):
 if (audience is None):
  return
 audience_in_payload = payload_dict.get('aud')
 if (audience_in_payload is None):
  raise AppIdentityError('No aud field in token: {0}'.format(payload_dict))
 if (audience_in_payload != audience):
  raise AppIdentityError('Wrong recipient, {0} != {1}: {2}'.format(audience_in_payload, audience, payload_dict))

def _check_audience ( payload_dict , audience ) : if ( audience is None ) : return audience_in_payload = payload_dict . get ( 'aud' ) if ( audience_in_payload is None ) : raise AppIdentityError ( 'No aud field in token: {0}' . format ( payload_dict ) ) if ( audience_in_payload != audience ) : raise AppIdentityError ( 'Wrong recipient, {0} != {1}: {2}' . format ( audience_in_payload , audience , payload_dict ) )
checks audience field from a jwt payload .