cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Details of Write/Read Options and Value - Calling LDAP Protocol Functions

Selle1
Explorer
0 Kudos
246

Based on Calling LDAP Protocol Functions - SAP Documentation, these are the following Write/Read Options with Option Number fields:

  • 2: LDAP_OPT_DEREF

  • 3: LDAP_OPT_SIZELIMIT

  • 4: LDAP_OPT_TIMELIMIT

  • 8: LDAP_OPT_REFERRALS

  • 9: LDAP_OPT_RESTART

  • 17: LDAP_OPT_PROTOCOL_VERSION

  • 49: LDAP_OPT_ERROR_NUMBER

I would like to seek more details to the meaning of each option above and its recommended option value.

I don't have the product documentation stated to the link and not found in F1 help either.

Accepted Solutions (0)

Answers (2)

Answers (2)

umasaral
Contributor

Hi 

Please check these comments

1. LDAP_OPT_DEREF (2):
Meaning: Controls how aliases are handled during searches.
Recommended Value: `LDAP_DEREF_ALWAYS` to always dereference aliases, or `LDAP_DEREF_NEVER` to never dereference.

2. LDAP_OPT_SIZELIMIT (3):
Meaning: Sets the maximum number of entries returned by a search.
Recommended Value: Set to `0` for no limit or a specific integer value based on your needs.

3. LDAP_OPT_TIMELIMIT (4):
Meaning: Sets the maximum time in seconds for a search operation.
Recommended Value: Set to `0` for no limit or a reasonable value like `30` seconds.

4. LDAP_OPT_REFERRALS (8):
Meaning: Controls whether referrals should be followed or not.
Recommended Value: `LDAP_OPT_ON` to follow referrals, or `LDAP_OPT_OFF` to ignore them.

5. LDAP_OPT_PROTOCOL_VERSION (17):
Meaning: Specifies the version of the LDAP protocol to use.
Recommended Value: Use `3` for LDAP version 3, which is the most commonly used version.

You can apply these options based on your specific LDAP configuration and requirements.

Selle1
Explorer
0 Kudos
Hi Umasaral, thank you for your inputs. Can you also provide details for 9: LDAP_OPT_RESTART and 49: LDAP_OPT_ERROR_NUMBER?
umasaral
Contributor
0 Kudos

Hi 

Please find the details for `LDAP_OPT_RESTART` and `LDAP_OPT_ERROR_NUMBER`:

LDAP_OPT_RESTART (Option Number: 9)
Meaning: This option controls whether the LDAP client should automatically retry an operation after a transient failure, such as a network timeout.
Functionality:
If enabled, the client attempts to reconnect and retry the operation if it encounters specific errors (like network interruptions).
This is useful for improving application resilience in environments with unstable connections.
Recommended Values:
`0`: Disable auto-restart (default behavior).
`1`: Enable auto-restart.

LDAP_OPT_ERROR_NUMBER (Option Number: 49)
Meaning: This option allows the client to retrieve the last error code that occurred during an LDAP operation.
Functionality:
After performing an LDAP operation (e.g., search, bind), you can check this option to get the integer error code representing the type of error encountered.
This is particularly useful for debugging and handling specific error scenarios in your application logic.
Usage: Typically, you call the function to retrieve the error number after an operation fails, and it does not have a setting value since it is read-only.