Answers.Body: <p>So, to close the loop on this, the answer is this:</p>
  
  <ol>
  <li>inside WP, but outside CiviCRM, the checksum and cid need to be identified on the GET string as cs and id respectively</li>
  <li>inside CiviCRM, the checksum stands alone (no separate variable, though it seems to work as cs too) and the client id must be cid as id is used for other purposes in CiviCRM.</li>
  </ol>
  
  <p>I discovered no way to cleanly pass these values through a page. I used a PHP insertion plugin to Wordpress to extract the values from the $_GET global array and pass them back into the page.</p>
  
  <p>Thanks to Demerit in helping me figure this out.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-09T21:04:52.400Z
Answers.LastActivityDate: 2019-10-09T21:04:52.400Z
Answers.UserDisplayName: kapn
Body: <p>I have a wordpress page with a user-dashboard shortcode embedded in it (<code>[civicrm component="user-dashboard" hijack="0"]</code>). When logged in, it works fine. When using a private window (and a user id and checksum) I get told I must be logged in to view the page.</p>
  
  <p>I assumed that I had forgotten to set the permission for anonymous users and the user-dashboard, but it seems I have that set correctly:
  <a href="https://i.sstatic.net/yrLsf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/yrLsf.png" alt="permissions for user dashboard"></a>
  I assume I'm missing something else obvious, but web searches (including this database) have revealed nothing. I would love an answer or even a suggestion of where to look.</p>
  
  <p>Based on the suggestion below, I've added some debug code to the user-dashboard:</p>
  
  <pre><code>  public function __construct() {
  parent::__construct();
  echo "&lt;!-- " . CRM_Core_Permission::check('access Contact Dashboard') . " --&gt;\n";
  if (!CRM_Core_Permission::check('access Contact Dashboard')) {
    CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/dashboard', 'reset=1'));
  }
  
  $this-&gt;_contactId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
  $userID = CRM_Core_Session::singleton()-&gt;getLoggedInContactID();
  
  echo "&lt;!-- userID:" . $userID . " --&gt;\n";
  $userChecksum = $this-&gt;getUserChecksum();
  echo "&lt;!-- userChecksum:" . $userChecksum . " --&gt;\n";
  </code></pre>
  
  <p>I was somewhat surprised to see that the checksum and cid aren't making it there:</p>
  
  <pre><code>&lt;!-- 1 --&gt;
  &lt;!-- userID: --&gt;
  &lt;!-- userChecksum: --&gt;
  &lt;div id="crm-container" class="crm-container" lang="en" xml:lang="en"&gt;
  </code></pre>
  
  <p>Now, this is a Wordpress page, not a civiCRM page, but I assumed that since there is a shortcode to add the user-dashboard, that these values would come through as well. Am I deluded in thinking this?</p>
  
  <p>For completeness, here is the (slightly redacted) url: <a href="https://mywebsite.com/workshop-registration/?aca11184e16a867aeee5f317ab706f58_1570552008_1440&amp;cid=2" rel="nofollow noreferrer">https://mywebsite.com/workshop-registration/?aca11184e16a867aeee5f317ab706f58_1570552008_1440&amp;cid=2</a></p>
  
  <p>I also tried this one just in case: <a href="https://mywebsite.com/workshop-registration/?cs=aca11184e16a867aeee5f317ab706f58_1570552008_1440&amp;cid=2" rel="nofollow noreferrer">https://mywebsite.com/workshop-registration/?cs=aca11184e16a867aeee5f317ab706f58_1570552008_1440&amp;cid=2</a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-08T17:54:58.577Z
Comments.Text: Try adding in some debugging lines in CRM/Contact/Page/View/UserDashBoard.php to see what it doesn't like. There's a couple different checks in construct() there. You said you have an id and checksum, but maybe something's not matching up.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-08T21:04:08.500Z
Comments.Text: Based on your update try using the cs= version but change cid to id.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-09T21:00:44.907Z
Comments.Text: Thanks Demerit. I did that and got in. Howevcer, I discovered in the process a strange inconsistency that I guess emerges from the fact that CiviCRM didn't start on WP. In a WP page, it indeed needs to be 'id'. However, in CiviCRM it is definitely cid. This creates a weird situation where I have to do some fancy dancing with PHP code snippets embedded in the background. Probably the simplest solution is going to be to give in and create accounts for everyone. Not really what I want to do.
Comments.UserDisplayName: kapn
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-09T21:03:55.287Z
Comments.Text: It's not a WP vs civi thing. The user dashboard page is looking for id in the url if there is no logged in user.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-09T21:09:21.717Z
Comments.Text: but in Civi, 'id' is used in the GET string to select an event or contribution page and 'cid' is used for the client id. For example: `https://mysite.com/?page=CiviCRM&q=civicrm%2Fevent%2Fregister&reset=1&id=2` points to event page 2
Comments.UserDisplayName: kapn
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-09T21:12:08.677Z
Comments.Text: Yes you're right that across pages it is sometimes inconsistent, but the user dashboard page is always id, not related to it being WP/Drupal/Joomla.
Comments.UserDisplayName: Demerit
Tags: <wordpress><user-dashboard>
Title: Anonymous user can't view CiviCRM user dashboard in WordPress
ThreadText: # Anonymous user can't view CiviCRM user dashboard in WordPress
  
  (Asked by: username_0 on 2019-10-08)
  
  I have a wordpress page with a user-dashboard shortcode embedded in it (`[civicrm component="user-dashboard" hijack="0"]`). When logged in, it works fine. When using a private window (and a user id and checksum) I get told I must be logged in to view the page.
  
  I assumed that I had forgotten to set the permission for anonymous users and the user-dashboard, but it seems I have that set correctly:
  [![permissions for user dashboard](https://i.sstatic.net/yrLsf.png)](https://i.sstatic.net/yrLsf.png)
  I assume I'm missing something else obvious, but web searches (including this database) have revealed nothing. I would love an answer or even a suggestion of where to look.
  
  Based on the suggestion below, I've added some debug code to the user-dashboard:
  
  ```
    public function __construct() {
  parent::__construct();
  echo "<!-- " . CRM_Core_Permission::check('access Contact Dashboard') . " -->\n";
  if (!CRM_Core_Permission::check('access Contact Dashboard')) {
    CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/dashboard', 'reset=1'));
  }
  
  $this->_contactId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
  $userID = CRM_Core_Session::singleton()->getLoggedInContactID();
  
  echo "<!-- userID:" . $userID . " -->\n";
  $userChecksum = $this->getUserChecksum();
  echo "<!-- userChecksum:" . $userChecksum . " -->\n";
  
  ```
  
  I was somewhat surprised to see that the checksum and cid aren't making it there:
  
  ```
  <!-- 1 -->
  <!-- userID: -->
  <!-- userChecksum: -->
  <div id="crm-container" class="crm-container" lang="en" xml:lang="en">
  
  ```
  
  Now, this is a Wordpress page, not a civiCRM page, but I assumed that since there is a shortcode to add the user-dashboard, that these values would come through as well. Am I deluded in thinking this?
  
  For completeness, here is the (slightly redacted) url: <https://mywebsite.com/workshop-registration/?aca11184e16a867aeee5f317ab706f58_1570552008_1440&cid=2>
  
  I also tried this one just in case: <https://mywebsite.com/workshop-registration/?cs=aca11184e16a867aeee5f317ab706f58_1570552008_1440&cid=2>
  
  **Tags:** wordpress, user-dashboard
  
  > **Comments:**
  > **username_1**: Try adding in some debugging lines in CRM/Contact/Page/View/UserDashBoard.php to see what it doesn't like. There's a couple different checks in construct() there. You said you have an id and checksum, but maybe something's not matching up.  
  > **username_1**: Based on your update try using the cs= version but change cid to id.  
  > **username_0**: Thanks username_1. I did that and got in. Howevcer, I discovered in the process a strange inconsistency that I guess emerges from the fact that CiviCRM didn't start on WP. In a WP page, it indeed needs to be 'id'. However, in CiviCRM it is definitely cid. This creates a weird situation where I have to do some fancy dancing with PHP code snippets embedded in the background. Probably the simplest solution is going to be to give in and create accounts for everyone. Not really what I want to do.  
  > **username_1**: It's not a WP vs civi thing. The user dashboard page is looking for id in the url if there is no logged in user.  
  > **username_0**: but in Civi, 'id' is used in the GET string to select an event or contribution page and 'cid' is used for the client id. For example: `https://mysite.com/?page=CiviCRM&q=civicrm%2Fevent%2Fregister&reset=1&id=2` points to event page 2  
  > **username_1**: Yes you're right that across pages it is sometimes inconsistent, but the user dashboard page is always id, not related to it being WP/Drupal/Joomla.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-10-09. Score: 2 | Accepted answer
  
  So, to close the loop on this, the answer is this:
  
  1. inside WP, but outside CiviCRM, the checksum and cid need to be identified on the GET string as cs and id respectively
  2. inside CiviCRM, the checksum stands alone (no separate variable, though it seems to work as cs too) and the client id must be cid as id is used for other purposes in CiviCRM.
  
  I discovered no way to cleanly pass these values through a page. I used a PHP insertion plugin to Wordpress to extract the values from the $\_GET global array and pass them back into the page.
  
  Thanks to username_1 in helping me figure this out.
  
  
  ---
  
  