Closed shiraze closed 1 year ago
Hi,
If you want to use the "as-is" PassThrough in plugin-scim, you may:
replace
https://github.com/jelhub/scimgateway/blob/master/lib/plugin-scim.js#L660
with
options.headers.Authorization = ctx.request.header.authorization
If you want header to be updated on each request (in case password is changed and gateway not restarted), you must put logic below:
https://github.com/jelhub/scimgateway/blob/master/lib/plugin-scim.js#L681
like:
options.headers.Authorization = ctx.request.header.authorization
Regards, Jarle
Line 660 should not be replaced as previously mentioned
Instead replace:
https://github.com/jelhub/scimgateway/blob/master/lib/plugin-scim.js#L592
with:
Authorization: ctx ? ctx.request.header.authorization : 'Basic ' + Buffer.from(`${config.entity[baseEntity].username}:${scimgateway.getPassword(`endpoint.entity.${baseEntity}.password`, configFile)}`).toString('base64')
v4.2.4 now includes Auth PassThrough support for provided plugins
Following on from #75 it would be helpful if sample code showed how this could be done.