40.2 GET_ALL_USER_ATTRIBUTES Procedure
This procedure returns two OUT arrays of user_attribute
names and values for the user name designated by p_username
(with password if required) using the provided auth base, host, and port.
Syntax
APEX_LDAP.GET_ALL_USER_ATTRIBUTES (
p_username IN VARCHAR2 DEFAULT NULL,
p_pass IN VARCHAR2 DEFAULT NULL,
p_auth_base IN VARCHAR2 DEFAULT NULL,
p_host IN VARCHAR2,
p_port IN VARCHAR2 DEFAULT 636,
p_use_ssl IN VARCHAR2 DEFAULT 'N',
p_attributes OUT apex_application_global.vc_arr2,
p_attribute_values OUT apex_application_global.vc_arr2,
p_credential_static_id IN VARCHAR2 DEFAULT NULL );
Parameters
Parameter | Description |
---|---|
p_username |
Login name of the user. |
p_pass |
Password for p_username .
|
p_auth_base |
LDAP search base, for example, dc=users,dc=my,dc=org .
|
p_host |
LDAP server host name. |
p_port |
LDAP server port number. |
p_use_ssl |
(Default) Set to Set to Set to |
p_attributes |
An array of attribute names returned. |
p_attribute_values |
An array of values returned for each corresponding attribute name returned in p_attributes .
|
p_credential_static_id |
The credential static ID (can be NULL for anonymous or username/pass binds). If it is not NULL and the credential could not be found, then raises the error |
Example
The following example demonstrates how to use the APEX_LDAP.GET_ALL_USER_ATTRIBUTES
procedure to retrieve all attribute value's associated to a user.
DECLARE
L_ATTRIBUTES apex_application_global.vc_arr2;
L_ATTRIBUTE_VALUES apex_application_global.vc_arr2;
BEGIN
APEX_LDAP.GET_ALL_USER_ATTRIBUTES(
p_username => 'firstname.lastname',
p_pass => 'abcdef',
p_auth_base => 'cn=user,l=amer,dc=example,dc=com',
p_host => 'our_ldap_sever.example.com',
p_port => '636',
p_user_ssl => 'A',
p_attributes => L_ATTRIBUTES,
p_attribute_values => L_ATTRIBUTE_VALUES);
FOR i IN L_ATTRIBUTES.FIRST..L_ATTRIBUTES.LAST LOOP
htp.p('attribute name: '||L_ATTRIBUTES(i));
htp.p('attribute value: '||L_ATTRIBUTE_VALUES(i));
END LOOP;
END;
Parent topic: APEX_LDAP