Body: <p>CiviCRM 5.58.1, vanilla WordPress 6.1.1  with the default theme.</p>
  <p>Both <strong>CiviCRM: access AJAX API</strong>  and <strong>CiviCRM: access CiviCRM backend and API</strong> are checked. Still, executing
  <code>CRM.api4('Contact', 'autocomplete', {input: term}).then(function(result) {</code></p>
  <p>works only for  &quot;administrator&quot; role. Anonymous gets redirected to</p>
  <pre><code>wp-login.php?redirect_to=http%3A%2F%2Fwordpress.site%2Fwp-admin%2Fadmin.php%3Fpage%3DCiviCRM%26q%3Dcivicrm%252Fajax%252Fapi4%252FContact%252Fautocomplete&amp;reauth=1 
  </code></pre>
  <p>Moreover, even if ALL &quot;CiviCRM: administer CiviCRM{system,data}&quot; and &quot;Skip IDs check&quot;  permissons   granted to anonymous, the system still redirects to wp_login.php</p>
  <p>Where and how to loose this a bit? Anonymous would like to search for Contacts in Civi database!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-02-28T22:28:38.420Z
Comments.Text: Do you have Authx ext enabled?
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-02-28T23:18:20.463Z
Comments.Text: No I don't,  should I?
Comments.UserDisplayName: yurg
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-03-01T11:49:20.123Z
Comments.Text: Have it enabled and disabled all guards - still no response from API call for anonymous.
Comments.UserDisplayName: yurg
Tags: <wordpress><api><permissions><apiv4>
Title: CiviCRM: access AJAX API not respected in Wordpress
ThreadText: # CiviCRM: access AJAX API not respected in Wordpress
  
  (Asked by: username_0 on 2023-02-28)
  
  CiviCRM 5.58.1, vanilla WordPress 6.1.1  with the default theme.
  Both CiviCRM: access AJAX API  and CiviCRM: access CiviCRM backend and API are checked. Still, executing
  CRM.api4('Contact', 'autocomplete', {input: term}).then(function(result) {
  works only for  "administrator" role. Anonymous gets redirected to
  wp-login.php?redirect_to=http%3A%2F%2Fwordpress.site%2Fwp-admin%2Fadmin.php%3Fpage%3DCiviCRM%26q%3Dcivicrm%252Fajax%252Fapi4%252FContact%252Fautocomplete&reauth=1 
  
  Moreover, even if ALL "CiviCRM: administer CiviCRM{system,data}" and "Skip IDs check"  permissons   granted to anonymous, the system still redirects to wp_login.php
  Where and how to loose this a bit? Anonymous would like to search for Contacts in Civi database!
  
  **Tags:** wordpress, api, permissions, apiv4
  
  > **Comments:**
  > **username_1**: Do you have Authx ext enabled?  
  > **username_0**: No I don't,  should I?  
  > **username_0**: Have it enabled and disabled all guards - still no response from API call for anonymous.  
  
  ---
  
  ## 0 answers
  
  