From f6cd25741b3ab40ccd24a30f044582377f95dcc1 Mon Sep 17 00:00:00 2001
From: Eugen Neuber <eugen.neuber@tugraz.at>
Date: Mon, 8 Mar 2021 11:33:53 +0100
Subject: [PATCH] Update auth/README.md for external pages

Setting auth/token in <dbp-components> directly without <dbp-provider>
---
 packages/auth/README.md | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/packages/auth/README.md b/packages/auth/README.md
index 0a71a8c0..93220f19 100644
--- a/packages/auth/README.md
+++ b/packages/auth/README.md
@@ -72,6 +72,29 @@ The component emits a `dbp-set-property` event for the attribute `auth`:
 
 The component emits a `dbp-set-property` event for the attribute `requested-login-status` (possible values `logged-in`, `logged-out`).
 
+
+## Alternative to &lt;dbp-auth&gt;
+
+If embedded in an external page (without `<dbp-provider>`) components can work also together with a different source for the auth token:
+```html
+<dbp-person-select id="ps-1"></dbp-person-select>
+<script>
+  function onAuthHasChanged(auth) {
+      /* fully featured auth object */
+    const ps = document.getElementById('ps-1');
+    ps.setProperty('auth', auth);
+  }
+  /* or */
+  function onTokenHasChanged(token) {
+      /* only token available */
+    const auth = { token: token };
+    onAuthHasChanged(auth);
+  }
+</script>
+```
+PS: some components need information about the logged in person too!
+
+
 ## Local development
 
 ```bash
-- 
GitLab