Home > APEX_LDAP > IS_MEMBER Function
![]() Previous |
![]() Next |
The IS_MEMBER function returns a boolean true if the user named by p_username (with password if required) is a member of the group specified by the p_group and p_group_base parameters using the provided auth base, host, and port.
Syntax
APEX_LDAP.IS_MEMBER(
p_username IN VARCHAR2,
p_pass IN VARCHAR2 DEFAULT NULL,
p_auth_base IN VARCHAR2,
p_host IN VARCHAR2,
p_port IN VARCHAR2 DEFAULT 389,
p_group IN VARCHAR2,
p_group_base IN VARCHAR2)
RETURN BOOLEAN;
Parameters
Table: IS_MEMBER Parameters describes the parameters available in the IS_MEMBER function.
IS_MEMBER Parameters
| Parameter | Description |
|---|---|
|
|
Login name of the user. |
|
|
Password for |
|
|
LDAP search base, for example, |
|
|
LDAP server host name. |
|
|
LDAP server port number. |
|
|
Name of the group to be search for membership. |
|
|
The base from which the search should be started. |
Example
The following example demonstrates how to use the APEX_LDAP.IS_MEMBER function to verify whether a user is a member of a group against an LDAP server.
DECLARE
L_VAL boolean;
BEGIN
L_VAL := APEX_LDAP.IS_MEMBER(
p_username =>'firstname.lastname',
p_pass =>'abcdef',
p_auth_base => 'cn=user,l=amer,dc=my_company,dc=com',
p_host => 'our_ldap_sever.my_company.com',
p_port => 389,
p_group => 'group_name',
p_group_base => 'group_base');
IF L_VAL THEN
htp.p('Is a member.');
ELSE
htp.p('Not a member.');
END IF;
END;