{"version":"1.0","type":"rich","title":"Gist 5600900","description":"This example demonstrates a minimal Ruby script for authenticating a user against an LDAP directory using the ActiveLDAP library. It shows the setup of an LDAP connection to a specified host and base DN, followed by a `User` class that defines an `authenticate` method, which finds an entry by distinguished name and attempts to bind with the provided password. The script rescues specific LDAP errors, returning `nil` on failure, and includes a test call at the bottom that prints the authentication result for hardcoded credentials.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-5600900?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}