From 9d9b77fc411f8ad2abcd4080ad4fe828c867c469 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Thu, 13 Nov 2025 11:39:46 -0700 Subject: [PATCH 1/7] remove unused enableSecureSignals flag and load scripts corectly --- .../google-secure-signals/client-server/views/index.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/views/index.html b/web-integrations/google-secure-signals/client-server/views/index.html index fe5ba60..41ab2d0 100644 --- a/web-integrations/google-secure-signals/client-server/views/index.html +++ b/web-integrations/google-secure-signals/client-server/views/index.html @@ -57,7 +57,6 @@ if (eventType === "SdkLoaded") { sdk.init({ baseUrl: "<%- uidBaseUrl %>", - enableSecureSignals: true, }); } }); @@ -77,9 +76,6 @@ - - - <%- include('intro.html'); -%> @@ -129,5 +125,8 @@ + + + From 7e03f214ddfb88df176cf7e917783e31ebdb276d Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Thu, 13 Nov 2025 12:36:17 -0700 Subject: [PATCH 2/7] update token generation page flow for successful token --- .../google-secure-signals/client-server/server.js | 7 ++++++- .../google-secure-signals/client-server/views/index.html | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/web-integrations/google-secure-signals/client-server/server.js b/web-integrations/google-secure-signals/client-server/server.js index b8ddb6b..0d7004e 100644 --- a/web-integrations/google-secure-signals/client-server/server.js +++ b/web-integrations/google-secure-signals/client-server/server.js @@ -37,6 +37,7 @@ app.set('view engine', 'html'); app.get('/', (req, res) => { res.render('index', { + identity: undefined, uidBaseUrl, uidJsSdkUrl, uidJsSdkName, @@ -133,6 +134,7 @@ app.post('/login', async (req, res) => { if (response.status === 'optout') { res.render('optout', { + identity: undefined, uidBaseUrl, uidJsSdkUrl, uidJsSdkName, @@ -142,6 +144,7 @@ app.post('/login', async (req, res) => { }); } else if (response.status !== 'success') { res.render('error', { + identity: undefined, error: 'Got unexpected token generate status in decrypted response: ' + response.status, response, identityName, @@ -149,13 +152,14 @@ app.post('/login', async (req, res) => { }); } else if (typeof response.body !== 'object') { res.render('error', { + identity: undefined, error: 'Unexpected token generate response format in decrypted response: ' + response, response, identityName, docsBaseUrl }); } else { - res.render('login', { + res.render('index', { identity: response.body, uidBaseUrl, uidJsSdkUrl, @@ -167,6 +171,7 @@ app.post('/login', async (req, res) => { } } catch (error) { res.render('error', { + identity: undefined, error, response: error.response, identityName, diff --git a/web-integrations/google-secure-signals/client-server/views/index.html b/web-integrations/google-secure-signals/client-server/views/index.html index 41ab2d0..1e2fe79 100644 --- a/web-integrations/google-secure-signals/client-server/views/index.html +++ b/web-integrations/google-secure-signals/client-server/views/index.html @@ -60,6 +60,15 @@ }); } }); + sdk.callbacks.push((eventType, payload) => { + if (eventType === 'InitCompleted') { + <% if (typeof identity !== 'undefined') { %> + if (sdk.isLoginRequired()) { + sdk.setIdentity(<%- JSON.stringify(identity) %>); + } + <% } %> + } + }); sdk.callbacks.push(onIdentityUpdated); }); From b7e88170c0ba1f6cc1b5adfa90ac3136cd62222b Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Thu, 13 Nov 2025 13:21:31 -0700 Subject: [PATCH 3/7] update and simplify flow --- .../client-server/server.js | 13 ++- .../client-server/views/index.html | 94 ++++++++++++++++--- .../client-server/views/login.html | 39 -------- .../client-server/views/optout.html | 19 ---- 4 files changed, 90 insertions(+), 75 deletions(-) delete mode 100644 web-integrations/google-secure-signals/client-server/views/login.html delete mode 100644 web-integrations/google-secure-signals/client-server/views/optout.html diff --git a/web-integrations/google-secure-signals/client-server/server.js b/web-integrations/google-secure-signals/client-server/server.js index 0d7004e..6f32122 100644 --- a/web-integrations/google-secure-signals/client-server/server.js +++ b/web-integrations/google-secure-signals/client-server/server.js @@ -38,10 +38,12 @@ app.set('view engine', 'html'); app.get('/', (req, res) => { res.render('index', { identity: undefined, + isOptout: false, uidBaseUrl, uidJsSdkUrl, uidJsSdkName, secureSignalsSdkUrl, + secureSignalsStorageKey: process.env.UID_SECURE_SIGNALS_STORAGE_KEY, identityName, docsBaseUrl }); @@ -133,18 +135,19 @@ app.post('/login', async (req, res) => { const response = decrypt(encryptedResponse.data, uidClientSecret, nonce); if (response.status === 'optout') { - res.render('optout', { - identity: undefined, + res.render('index', { + identity: null, + isOptout: true, uidBaseUrl, uidJsSdkUrl, uidJsSdkName, secureSignalsSdkUrl, + secureSignalsStorageKey: process.env.UID_SECURE_SIGNALS_STORAGE_KEY, identityName, docsBaseUrl }); } else if (response.status !== 'success') { res.render('error', { - identity: undefined, error: 'Got unexpected token generate status in decrypted response: ' + response.status, response, identityName, @@ -152,7 +155,6 @@ app.post('/login', async (req, res) => { }); } else if (typeof response.body !== 'object') { res.render('error', { - identity: undefined, error: 'Unexpected token generate response format in decrypted response: ' + response, response, identityName, @@ -161,17 +163,18 @@ app.post('/login', async (req, res) => { } else { res.render('index', { identity: response.body, + isOptout: false, uidBaseUrl, uidJsSdkUrl, uidJsSdkName, secureSignalsSdkUrl, + secureSignalsStorageKey: process.env.UID_SECURE_SIGNALS_STORAGE_KEY, identityName, docsBaseUrl }); } } catch (error) { res.render('error', { - identity: undefined, error, response: error.response, identityName, diff --git a/web-integrations/google-secure-signals/client-server/views/index.html b/web-integrations/google-secure-signals/client-server/views/index.html index 1e2fe79..51ff32e 100644 --- a/web-integrations/google-secure-signals/client-server/views/index.html +++ b/web-integrations/google-secure-signals/client-server/views/index.html @@ -7,6 +7,9 @@ + + + @@ -114,7 +175,18 @@ <%- identityName %> Identity Callback State:

       
+      
+        Secure Signals Loaded?
+        

+      
+      
+        Secure Signals Value:
+        

+      
     
+    
     
     
+    
-    
-    
-    
   
 
diff --git a/web-integrations/google-secure-signals/client-server/views/login.html b/web-integrations/google-secure-signals/client-server/views/login.html
deleted file mode 100644
index 0112178..0000000
--- a/web-integrations/google-secure-signals/client-server/views/login.html
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-  
-    
-    Login - Client-Server <%- identityName %> SDK Integration Example with Google Secure Signals
-    
-    
-    
-    
-    
-
-    
-  
-  
-    <%- include('intro.html'); -%>
-    

Generate <%- identityName %> completed

-

<%- identityName %> identity:

-
<%- JSON.stringify(identity, null, 2) %>
-

Back to the main page

-

- Normally user would be redirected automatically, but this example demonstrates one way <%- identityName %> - generation could be handled. -

- - diff --git a/web-integrations/google-secure-signals/client-server/views/optout.html b/web-integrations/google-secure-signals/client-server/views/optout.html deleted file mode 100644 index b6957e4..0000000 --- a/web-integrations/google-secure-signals/client-server/views/optout.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Opted Out - Client-Server <%- identityName %> SDK Integration Example with Google Secure Signals - - - - - <%- include('intro.html'); -%> -

This email has opted out

-

- The email address you entered has opted out of <%- identityName %>. No <%- identityName %> token can be generated for this - email. -

-

Back to the main page

- - - From 118255e184f423e39a72427b7b16931f3c68d5d3 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Thu, 13 Nov 2025 13:43:38 -0700 Subject: [PATCH 4/7] display video under page title/intro --- .../client-server/views/index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/views/index.html b/web-integrations/google-secure-signals/client-server/views/index.html index 51ff32e..2db9f47 100644 --- a/web-integrations/google-secure-signals/client-server/views/index.html +++ b/web-integrations/google-secure-signals/client-server/views/index.html @@ -84,7 +84,7 @@ ) { ++callbackCounter; } - // Allow time for secure signals to load + // Allow secure signals time to load setTimeout(() => updateGuiElements(payload), 1000); } @@ -135,6 +135,12 @@ + <%- include('intro.html'); -%> +

+ Note: This is a test-only integration environment—not for production + use. It does not perform real user authentication or generate production-level tokens. Do not + use real user data on this page. +