apigee / microgateway-plugins

Plugins for microgateway, oauth, analytics, spike arrest, etc...
Other
30 stars 54 forks source link

Update extauth index.js to send x-client-id header #172

Closed satishbkodali closed 3 years ago

satishbkodali commented 4 years ago

@keyurkarnik @srinandan

Looks like this plugin is not adding client_id to x-api-key header because of false check

In line 127 and 165, checking for not sendErr. But sendErr is defaulted to true, which makes this check to False. But we need it as true Could you please fix this. as x-api-key is not being passed to oauth plugin and causing issues

Actual :

if (!sendErr) 
    //if this plugin is not sending errors, assume MG is not in local mode
    req.headers['x-api-key'] = jwtdecode.payloadObj[client_id];
}

Expected:

if (sendErr) 
    //if this plugin is not sending errors, assume MG is not in local mode
    req.headers['x-api-key'] = jwtdecode.payloadObj[client_id];
}
satishbkodali commented 3 years ago

Fixed as part of #208