You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs: local development identities
Signed-off-by: David Dal Busco <david.dalbusco@outlook.com>
* 📄 Update LLMs.txt snapshot for PR review
---------
Signed-off-by: David Dal Busco <david.dalbusco@outlook.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Implementing Google, Internet Identity, or Passkeys requires some setup and doesn't always fit best in a local development environment or E2E test suite. For example, they take various steps to complete and therefore consume repetitive time.
774
+
775
+
Local dev identities skip all that.
776
+
777
+
They let you test authentication flows instantly - no setup, no external services, no waiting. Just one click with names like "alice" or "bob", and you're signed in.
778
+
779
+
**Caution:**
780
+
781
+
**For local development only** - works exclusively on `localhost` and `127.0.0.1`.
782
+
783
+
---
784
+
785
+
## How It Works
786
+
787
+
1. You optionally provide an identifier (e.g., "alice", "bob"). Default is "dev".
788
+
2. A deterministic identity is generated on the client side from that identifier.
789
+
3. The identifier is stored in IndexedDB and reused across sessions.
790
+
4. You can switch between different dev identities easily.
791
+
792
+
**Note:**
793
+
794
+
Given the deterministic nature of these identities, as mentioned above, they cannot be used in production. That's why the library prevents any usage outside of localhost.
795
+
796
+
---
797
+
798
+
## Sign-In
799
+
800
+
```
801
+
import { signIn } from "@junobuild/core";// ⚠️ LOCAL DEVELOPMENT ONLY - Replace with a real provider for productionawait signIn({ dev: {}});
802
+
```
803
+
804
+
---
805
+
806
+
## Options
807
+
808
+
| Option | Type | Default | Description |
809
+
| --- | --- | --- | --- |
810
+
| `identifier` | `string` | `"dev"` | Unique identifier for this dev identity (max 32 characters) |
811
+
| `maxTimeToLiveInMilliseconds` | `number` | 7 days | How long the session lasts in milliseconds |
812
+
813
+
Example:
814
+
815
+
```
816
+
// ⚠️ LOCAL DEVELOPMENT ONLY - Replace with a real provider for productionawait signIn({ dev: { identifier: "alice", maxTimeToLiveInMilliseconds: 24 * 60 * 60 * 1000 // 1 day }});
817
+
```
818
+
819
+
---
820
+
821
+
---
822
+
823
+
## Managing Identifiers
824
+
825
+
During development, you may want to see which identities you've used or clear them out.
826
+
827
+
---
828
+
829
+
### Load
830
+
831
+
Retrieve all previously used dev identifiers, sorted by most recent first:
832
+
833
+
```
834
+
import { loadDevIdentifiers } from "@junobuild/ic-client/dev";// ⚠️ DEV UTILITY - Not needed for production appsconst identifiers = await loadDevIdentifiers();// [['alice', { createdAt: 1234567890, updatedAt: 1234567899 }], ...]// You can also limit resultsconst recent = await loadDevIdentifiers({ limit: 5 });
835
+
```
836
+
837
+
---
838
+
839
+
### Clear
840
+
841
+
Remove all stored dev identifiers from browser's IndexedDB:
842
+
843
+
```
844
+
import { clearDevIdentifiers } from "@junobuild/ic-client/dev";// ⚠️ DEV UTILITY - Not needed for production appsawait clearDevIdentifiers();
845
+
```
846
+
847
+
**Note:**
848
+
849
+
Clearing identifiers only removes the usage history.
850
+
851
+
---
852
+
853
+
## Recommendations
854
+
855
+
* ⚠️ **Never use in production** - automatically blocked on non-localhost domains
856
+
* Use different identifiers to test multi-user scenarios
857
+
* Switch to real providers (Google, Internet Identity, Passkeys) before deploying
858
+
771
859
# Google
772
860
773
861
Google Sign-In lets users authenticate with their existing Google account using OpenID Connect (OIDC) - a modern, secure identity standard built on top of OAuth 2.0.
@@ -8720,7 +8808,7 @@ For most applications, we recommend using the default subnets and staying on the
8720
8808
8721
8809
| Subnet ID | Type | Canisters (Running/Stopped) | Nodes (Up/Total) |
Copy file name to clipboardExpand all lines: .llms-snapshots/llms.txt
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ Juno is your self-contained serverless platform for building full-stack web apps
17
17
18
18
## Build - Authentication
19
19
20
+
- [Development](https://juno.build/docs/build/authentication/dev.md): Learn how to use development identities for local testing or E2E with Juno without external authentication providers.
20
21
- [Google](https://juno.build/docs/build/authentication/google.md): Learn how to integrate Google Sign-In with Juno using OpenID Connect for secure, standards-based authentication.
21
22
- [Internet Identity](https://juno.build/docs/build/authentication/internet-identity.md): Learn how to integrate Internet Identity with Juno for decentralized, privacy-preserving authentication on the Internet Computer.
22
23
- [Management](https://juno.build/docs/build/authentication/management.md): This page provides an overview of the administrative functions available in the Juno Console related to user management.
description: Learn how to use development identities for local testing or E2E with Juno without external authentication providers.
4
+
keywords: [dev, local development, testing, localhost]
5
+
---
6
+
7
+
# Local Development and E2E
8
+
9
+
Implementing Google, Internet Identity, or Passkeys requires some setup and doesn't always fit best in a local development environment or E2E test suite. For example, they take various steps to complete and therefore consume repetitive time.
10
+
11
+
Local dev identities skip all that.
12
+
13
+
They let you test authentication flows instantly - no setup, no external services, no waiting. Just one click with names like "alice" or "bob", and you're signed in.
14
+
15
+
:::caution
16
+
17
+
**For local development only** - works exclusively on `localhost` and `127.0.0.1`.
18
+
19
+
:::
20
+
21
+
---
22
+
23
+
## How It Works
24
+
25
+
1. You optionally provide an identifier (e.g., "alice", "bob"). Default is "dev".
26
+
2. A deterministic identity is generated on the client side from that identifier.
27
+
3. The identifier is stored in IndexedDB and reused across sessions.
28
+
4. You can switch between different dev identities easily.
29
+
30
+
:::note
31
+
32
+
Given the deterministic nature of these identities, as mentioned above, they cannot be used in production.
33
+
That's why the library prevents any usage outside of localhost.
34
+
35
+
:::
36
+
37
+
---
38
+
39
+
## Sign-In
40
+
41
+
```typescript
42
+
import { signIn } from"@junobuild/core";
43
+
44
+
// ⚠️ LOCAL DEVELOPMENT ONLY - Replace with a real provider for production
0 commit comments