AnonymousAccess

Applies to

HTTPClient, RestClient, TokenRequest, OAuthRequest

Description

When the AnonymousAccess property is set to True, the client accesses the server anonymously (without using a certificate at the client). The default value is false.

Usage

Taking IIS as an example, when the SSL Settings in IIS is set to Accept, the request function will return an error code if no client certificate is used. In such a case, the anonymous access can be used to access the server.

The AnonymousAccess property takes a boolean value. The following examples access the server anonymously when the client failed to provide a certificate required by the server.

ln_rtn = l_httpclient.SendRequest("GET", "https://test.appeon.com")
If ln_rtn = -16 Then
  l_httpclient.anonymousAccess = true;
  l_httpclient.SendRequest("GET", "https://test.appeon.com")
End If
ln_rtn = l_restclient.SendGetRequest ("https://test.appeon.com")
If ln_rtn = -27 Then
  l_restclient.anonymousAccess = true;
  l_restclient.SendGetRequest ("https://test.appeon.com")
End If
ln_rtn = inv_OAuthClient.AccessToken(lnv_TokenRequest, lnv_TokenResponse)
If ln_rtn = -16 Then
  lnv_TokenRequest.anonymousAccess = true;
  inv_OAuthClient.AccessToken(lnv_TokenRequest, lnv_TokenResponse)
End If
lnv_OAuthRequest.Method = "GET"
lnv_OAuthRequest.URL = "https://test.appeon.com/product/100"
lnv_OAuthRequest.SetAccessToken(ls_AccessToken)
ln_rtn = inv_OAuthClient.RequestResource(lnv_OAuthRequest, lnv_ResourceResponse)
If ln_rtn = -16 Then
  lnv_OAuthRequest.anonymousAccess = true;
  l_OAuthClient.RequestResource(lnv_OAuthRequest, lnv_ResourceResponse)
End If