Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for requesting the CORE id in the getIdentity command #1175

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

jonsnyder
Copy link
Contributor

Description

  • Adds the ability to request "CORE" as a namespace in the getIdentity command
  • This namespace is only available when thirdPartyCookies are enabled. If third party cookies are not enabled, calling getIdentity with CORE as a namespace throws an error.
  • When third party cookies are enabled, all requests in Chrome include the query for "ECID" and "CORE". Otherwise requests only include the query for "ECID".
  • The default namespaces for the getIdentity command is still ["ECID"]

Related Issue

https://jira.corp.adobe.com/browse/PDCL-12492

Motivation and Context

TEST page

<!DOCTYPE html>
<head>
  <script>
  !function(n,o){o.forEach(function(o){n[o]||((n.__alloyNS=n.__alloyNS||
  []).push(o),n[o]=function(){var u=arguments;return new Promise(
  function(i,l){n.setTimeout(function(){n[o].q.push([i,l,u])})})},n[o].q=[])})}
  (window,["alloy"]);
</script>
  <!--<script src="https://cdn1.adoberesources.net/alloy/2.21.1/alloy.min.js" async></script>-->
  <script src="/alloy.js" async></script>
  <script>
    alloy("configure", {
	"datastreamId": "bc1a10e0-aee4-4e0e-ac5b-cdbb9abbec83",
	"orgId": "5BFE274A5F6980A50A495C08@AdobeOrg",
	"edgeBasePath": "ee-pre-prd"
    });
  </script>
</head>
<html>
<body>

  <h1>Test Page for Core ID Library</h1>

  <button id="sendEvent">Send Event</button>
  <button id="sendBeacon">Send Beacon</button>
  <button id="getIdentityE">Get Identity (ECID)</button>
  <button id="getIdentityC">Get Identity (CORE)</button>
  <button id="getIdentityEC">Get Identity (ECID & CORE)</button>
  
  <script>
    document.getElementById("sendEvent").addEventListener("click", () => {
	alloy("sendEvent", {});
    });
    document.getElementById("sendBeacon").addEventListener("click", () => {
	alloy("sendEvent", { documentUnloading: true });
    });
    document.getElementById("getIdentityE").addEventListener("click", () => {
	alloy("getIdentity", { namespaces: ["ECID"] }).then(console.log);
    });
    document.getElementById("getIdentityC").addEventListener("click", () => {
	alloy("getIdentity", { namespaces: ["CORE"] }).then(console.log);
    });
    document.getElementById("getIdentityEC").addEventListener("click", () => {
	alloy("getIdentity", { namespaces: ["ECID", "CORE"] }).then(console.log);
    });
    
  </script>
</body>
</html>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change which does not add functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA or I'm an Adobe employee.
  • I have made any necessary test changes and all tests pass.
  • I have run the Sandbox successfully.

Copy link
Contributor

@carterworks carterworks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Do we want to automatically add the CORE identity to the request-level identity map, like we do with the AMCV cookie?

@shammowla shammowla self-requested a review September 5, 2024 15:37
@jonsnyder
Copy link
Contributor Author

We shouldn't add the CORE id to the identity map because Experience edge can generate it from the ECID. This is the logic that experience edge uses: CORE = ECID xor hash(orgId), so it is reversible: ECID = CORE xor hash(orgId)

@jonsnyder jonsnyder merged commit 98e4e4c into main Sep 5, 2024
4 of 5 checks passed
@jonsnyder jonsnyder deleted the coreId branch September 5, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants