Lambda Function Buffer Error
-
Hello,
I'm trying to register users using user GUID.- Configured the LDAP for user authentication
- Created lambda function for LDAP response reading and setting user information
- We want to use LDAP user id to set in Fusion AUTH. objectGUID is configured as the attribute in LDAP configuration
This is the following function we used to convert ObjectGUID to string because ObjectGUID will be the binary.
const hexValue = Buffer.from(objectGUID, 'binary').toString('hex')
console.log(Buffer.from(objectGUID, 'binary')) console.log(hexValue) console.log(hexValue.replace( /([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{4})([0-9a-f]{10})/, '$4$3$2$1-$6$5-$8$7-$9-$10' ));
Buffer.from(objectGUID, 'binary') this function is not working in lambda function same peace of code work for normal javascript without any error.
ReferenceError: "Buffer" is not defined in <eval>Please suggest to me an alternative solution or how to fix this buffer issue.
Thanks
Hanumant -
There may be some additional insight to be gleaned from these two resources
- https://fusionauth.io/blog/2020/10/01/active-directory-connector/
- https://fusionauth.io/docs/v1/tech/connectors/ldap-connector/
FusionAuth also has a few helper functions that might be useful as well (and address your specific issue without the use of a
Buffer
).I hope this helps!
Thanks,
Josh
FusionAuth -
@joshua Thanks it worked
-
-