@startino/better-auth-oidc 0.1.8 → 0.1.9
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 +34 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -97,37 +97,40 @@ await client.signIn.sso({
|
|
|
97
97
|
Here is what happens during an SSO sign-in:
|
|
98
98
|
|
|
99
99
|
```
|
|
100
|
-
|
|
101
|
-
│
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
│
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
100
|
+
┌────────┐ ┌─────────────┐ ┌─────┐ ┌─────┐
|
|
101
|
+
│ Client │ │ Auth Server │ │ IdP │ │ App │
|
|
102
|
+
└───┬────┘ └──────┬──────┘ └──┬──┘ └──┬──┘
|
|
103
|
+
│ │ │ │
|
|
104
|
+
│ POST /sign-in/sso │ │ │
|
|
105
|
+
│───────────────────────>│ │ │
|
|
106
|
+
│ │ │ │
|
|
107
|
+
│ │ 302 → authorize │ │
|
|
108
|
+
│ │─────────────────────>│ │
|
|
109
|
+
│ │ │ │
|
|
110
|
+
│ │ User logs in │ │
|
|
111
|
+
│ │ │ │
|
|
112
|
+
│ │ GET /sso/callback │ │
|
|
113
|
+
│ │<─────────────────────│ │
|
|
114
|
+
│ │ │ │
|
|
115
|
+
│ │ Exchange code │ │
|
|
116
|
+
│ │ for tokens │ │
|
|
117
|
+
│ │─────────────────────>│ │
|
|
118
|
+
│ │<─────────────────────│ │
|
|
119
|
+
│ │ │ │
|
|
120
|
+
│ │ Create/link user │ │
|
|
121
|
+
│ │ Create session │ │
|
|
122
|
+
│ │ Generate OTT │ │
|
|
123
|
+
│ │ │ │
|
|
124
|
+
│ │ 302 → callbackURL?ott=TOKEN │
|
|
125
|
+
│ │────────────────────────────────────────>│
|
|
126
|
+
│ │ │ │
|
|
127
|
+
│ │ GET /sso/verify-ott?token=… │
|
|
128
|
+
│ │<────────────────────────────────────────│
|
|
129
|
+
│ │ │ │
|
|
130
|
+
│ │ Set session cookie on app domain │
|
|
131
|
+
│ │────────────────────────────────────────>│
|
|
132
|
+
│ │ │ │
|
|
133
|
+
▼ ▼ ▼ ▼
|
|
131
134
|
```
|
|
132
135
|
|
|
133
136
|
1. **Sign-in request.** The client calls `POST /sign-in/sso` with an email, domain, or provider ID. The plugin finds the matching SSO provider and builds the OIDC authorization URL.
|