Class: ListenerLdapUserStoreBasicAuthProvider

Isolated

Represents the LDAP-based listener Basic Auth provider, which is used to authenticate the provided credentials against the provided LDAP user store configurations. This connects to an active directory or an LDAP, retrieves the necessary user information, and performs authentication and authorization.

1auth:LdapUserStoreConfig config = {
2 domainName: "ballerina.io",
3 connectionURL: "ldap://localhost:389",
4 connectionName: "cn=admin,dc=avix,dc=lk"
5};
6auth:ListenerLdapUserStoreBasicAuthProvider provider = new(config);

Constructor

Creates an LDAP auth store with the provided configurations.

init (LdapUserStoreConfig ldapUserStoreConfig)

Methods

authenticate

Attempts to authenticate the Base64-encoded username:password credentials.

authenticate

function authenticate(string credential) returns UserDetails | Error
Isolated Function

Attempts to authenticate the Base64-encoded username:password credentials.

1auth:UserDetails result = check provider.authenticate("<credential>");

Parameters

  • credential string
  • The Base64-encoded username:password value

Return Type

(UserDetails | Error)

auth:UserDetails if the authentication is successful or else an auth:Error if an error occurred