capacitor-oidc 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -11
- package/docs/assets/capacitor-oidc-demo.gif +0 -0
- package/package.json +18 -2
package/README.md
CHANGED
|
@@ -4,21 +4,44 @@
|
|
|
4
4
|
[](https://github.com/jojopirker/capacitor-oidc/actions/workflows/ci.yml)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
7
|
+
`capacitor-oidc` is a simple OAuth 2.0 and OpenID Connect implementation for
|
|
8
|
+
Capacitor 7 and 8 on native iOS and Android, powered by
|
|
9
|
+
[`oidc-client-ts`](https://github.com/authts/oidc-client-ts). It uses
|
|
10
|
+
Authorization Code Flow with PKCE, native system authentication UI, and secure
|
|
11
|
+
storage.
|
|
12
|
+
|
|
13
|
+
## Why `capacitor-oidc`?
|
|
14
|
+
|
|
15
|
+
- Simple standards-based OAuth 2.0 and OIDC for Capacitor, without
|
|
16
|
+
provider-specific SDKs.
|
|
17
|
+
- The familiar `oidc-client-ts` `UserManager` API, session objects, and events.
|
|
18
|
+
- System authentication UI instead of an embedded WebView.
|
|
19
|
+
- Secure native storage for OIDC transactions and sessions.
|
|
20
|
+
- Refresh-token renewal when the app is active or resumes.
|
|
21
|
+
- A native-readable session snapshot for app widgets.
|
|
18
22
|
|
|
19
23
|
On iOS, authentication uses `ASWebAuthenticationSession`. On Android, it uses
|
|
20
24
|
AndroidX Auth Tab with its Custom Tab fallback.
|
|
21
25
|
|
|
26
|
+
## Compatibility
|
|
27
|
+
|
|
28
|
+
| Target | Support |
|
|
29
|
+
| --------- | -------------------------------------------- |
|
|
30
|
+
| Capacitor | 7 and 8 |
|
|
31
|
+
| iOS | 15 or newer; `ASWebAuthenticationSession` |
|
|
32
|
+
| Android | API 24 or newer; Auth Tab or Custom Tab |
|
|
33
|
+
| Flow | Authorization Code Flow with PKCE |
|
|
34
|
+
| Providers | Compatible OAuth 2.0 and OpenID Connect APIs |
|
|
35
|
+
| Web | Use `oidc-client-ts` directly |
|
|
36
|
+
|
|
37
|
+
## Demo
|
|
38
|
+
|
|
39
|
+
This example signs in against a local Keycloak realm with Authorization Code
|
|
40
|
+
Flow and PKCE, renews the session through its refresh token, and signs out at
|
|
41
|
+
the provider.
|
|
42
|
+
|
|
43
|
+

|
|
44
|
+
|
|
22
45
|
## Requirements
|
|
23
46
|
|
|
24
47
|
- Capacitor 7 or 8
|
|
@@ -73,6 +96,9 @@ Authorization Code Flow with PKCE.
|
|
|
73
96
|
the normal `UserManager` from `oidc-client-ts` and select the implementation with
|
|
74
97
|
`Capacitor.isNativePlatform()` in the application.
|
|
75
98
|
|
|
99
|
+
A runnable Keycloak-backed iOS application and its UI test live in
|
|
100
|
+
[`example`](example).
|
|
101
|
+
|
|
76
102
|
## Documentation
|
|
77
103
|
|
|
78
104
|
- [Getting started](docs/GETTING_STARTED.md)
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capacitor-oidc",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"description": "Capacitor plugin for native OAuth 2.0 and OpenID Connect authentication on iOS and Android, powered by oidc-client-ts.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"capacitor",
|
|
7
|
+
"capacitor-plugin",
|
|
8
|
+
"authentication",
|
|
9
|
+
"oauth",
|
|
10
|
+
"oauth2",
|
|
11
|
+
"openid-connect",
|
|
12
|
+
"oidc",
|
|
13
|
+
"pkce",
|
|
14
|
+
"ios",
|
|
15
|
+
"android",
|
|
16
|
+
"oidc-client-ts"
|
|
17
|
+
],
|
|
5
18
|
"main": "dist/plugin.cjs",
|
|
6
19
|
"module": "dist/esm/index.js",
|
|
7
20
|
"types": "dist/esm/index.d.ts",
|
|
@@ -34,6 +47,9 @@
|
|
|
34
47
|
"scripts": {
|
|
35
48
|
"build": "npm run clean && tsc && rollup -c rollup.config.mjs",
|
|
36
49
|
"clean": "rimraf dist",
|
|
50
|
+
"e2e:keycloak:down": "docker compose -f test/e2e/keycloak/compose.yml down",
|
|
51
|
+
"e2e:keycloak:up": "test/e2e/keycloak/create-certificate.sh test/e2e/keycloak/.certificates && docker compose -f test/e2e/keycloak/compose.yml up -d",
|
|
52
|
+
"example:build": "npm --prefix example run build",
|
|
37
53
|
"lint": "eslint src --ext ts && prettier --check src contracts package.json README.md SECURITY.md docs",
|
|
38
54
|
"prepack": "npm run build",
|
|
39
55
|
"test": "vitest run",
|