Skip to content

Commit 6104d6c

Browse files
committed
Merge branch 'main' into FGI-1575_manage_connected_accounts
2 parents 4f77836 + fe57431 commit 6104d6c

File tree

10 files changed

+268
-140
lines changed

10 files changed

+268
-140
lines changed

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ jobs:
3636
run: exit 0 # Skip unnecessary test runs for dependabot and merge queues. Artifically flag as successful, as this is a required check for branch protection.
3737

3838
- name: Checkout
39-
uses: actions/checkout@v5
39+
uses: actions/checkout@v6
4040

4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v3
42+
uses: github/codeql-action/init@v4
4343
with:
4444
languages: ${{ matrix.language }}
4545
queries: +security-and-quality
4646

4747
- name: Autobuild
48-
uses: github/codeql-action/autobuild@v3
48+
uses: github/codeql-action/autobuild@v4
4949

5050
- name: Perform CodeQL Analysis
51-
uses: github/codeql-action/analyze@v3
51+
uses: github/codeql-action/analyze@v4
5252
with:
5353
category: "/language:${{ matrix.language }}"

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
steps:
3434
- name: Checkout code
35-
uses: actions/checkout@v5
35+
uses: actions/checkout@v6
3636
with:
3737
fetch-depth: 0
3838
fetch-tags: true

.github/workflows/rl-scanner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
scan-status: ${{ steps.rl-scan-conclusion.outcome }}
3232

3333
steps:
34-
- uses: actions/checkout@v5
34+
- uses: actions/checkout@v6
3535
with:
3636
fetch-depth: 0
3737
fetch-tags: true

.github/workflows/snyk.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131
- if: github.actor == 'dependabot[bot]' || github.event_name == 'merge_group'
3232
run: exit 0 # Skip unnecessary test runs for dependabot and merge queues. Artifically flag as successful, as this is a required check for branch protection.
3333

34-
- uses: actions/checkout@v5
34+
- uses: actions/checkout@v6
3535
with:
3636
ref: ${{ github.event.pull_request.head.sha || github.ref }}
3737

38-
- uses: snyk/actions/python@b98d498629f1c368650224d6d212bf7dfa89e4bf # pin@0.4.0
38+
- uses: snyk/actions/python@9adf32b1121593767fc3c057af55b55db032dc04 # pin@1.0.0
3939
env:
4040
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
- name: Checkout code
29-
uses: actions/checkout@v5
29+
uses: actions/checkout@v6
3030

3131
- name: Set up Python ${{ matrix.python-version }}
3232
uses: actions/setup-python@v6

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0b6
1+
1.0.0b7

CHANGELOG.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
# Change Log
22

3-
## [1.0.0.b6](https://github.com/auth0/auth0-server-python/tree/1.0.0.b6) (2025-11-18)
4-
[Full Changelog](https://github.com/auth0/auth0-server-python/compare/1.0.0b5...1.0.0.b6)
3+
## [1.0.0.b7](https://github.com/auth0/auth0-server-python/tree/1.0.0b7) (2026-01-06)
4+
[Full Changelog](https://github.com/auth0/auth0-server-python/compare/1.0.0b6...1.0.0b7)
5+
6+
**Added**
7+
- docs: Add user unlinking example [\#62](https://github.com/auth0/auth0-server-python/pull/62)
8+
9+
## [1.0.0b6](https://github.com/auth0/auth0-server-python/tree/1.0.0b6) (2025-11-18)
10+
[Full Changelog](https://github.com/auth0/auth0-server-python/compare/1.0.0b5...1.0.0b6)
511

612
**Added**
713
- feat: FGI-1573 add MRRT support [\#58](https://github.com/auth0/auth0-server-python/pull/58) ([sam-muncke](https://github.com/sam-muncke))
814

915
- feat: FGI-1573 add connected account support [\#57](https://github.com/auth0/auth0-server-python/pull/57) ([sam-muncke](https://github.com/sam-muncke))
1016

11-
## [1.0.0.b5](https://github.com/auth0/auth0-server-python/tree/1.0.0.b5) (2025-09-15)
12-
[Full Changelog](https://github.com/auth0/auth0-server-python/compare/auth0_server_python-v1.0.0b4...1.0.0.b5)
17+
## [1.0.0b5](https://github.com/auth0/auth0-server-python/tree/1.0.0b5) (2025-09-15)
18+
[Full Changelog](https://github.com/auth0/auth0-server-python/compare/auth0_server_python-v1.0.0b4...1.0.0b5)
1319

1420
**Added**
1521
- feat: Updates for CIBA with Email [\#28](https://github.com/auth0/auth0-server-python/pull/28) ([adamjmcgrath](https://github.com/adamjmcgrath))

examples/UserLinking.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,103 @@ link_user_url = await server_client.start_link_user(options, store_options=store
127127
```
128128

129129
Read more above in [Configuring the Transaction and State Store](./ConfigureStore.md).
130+
131+
## Start Unlinking The User
132+
133+
User unlinking allows you to remove a previously linked identity from a user account. The process is similar to linking and begins by calling `start_unlink_user()` to obtain an authorization URL.
134+
135+
```python
136+
# Start the unlink user flow by providing the connection to unlink.
137+
options = {
138+
"connection": "google-oauth2", # The connection to unlink
139+
"authorization_params": {"redirect_uri": "http://localhost:3000/auth/callback"},
140+
"app_state": {"returnTo": "http://localhost:3000/profile"}
141+
}
142+
143+
# Assume store_options contains Request/Response objects required by the state store.
144+
store_options = {"request": request, "response": response}
145+
146+
unlink_user_url = await server_client.start_unlink_user(options, store_options=store_options)
147+
148+
# Redirect the user to unlink_user_url
149+
# (In a FastAPI route, you would return a RedirectResponse with unlink_user_url)
150+
```
151+
152+
Once the unlink user flow is completed, the user will be redirected back to the `redirect_uri` specified in the `authorization_params`. At that point, it's required to call `complete_unlink_user()` to finalize the user-unlinking process. Read more below in [Complete Unlinking The User](#complete-unlinking-the-user).
153+
154+
### Passing `authorization_params`
155+
156+
Just like `start_link_user()`, you can customize the parameters passed to the `/authorize` endpoint:
157+
158+
1. **Globally:**
159+
Configure them when instantiating the `ServerClient`.
160+
161+
2. **Per-call Override:**
162+
Supply them when calling `start_unlink_user()`.
163+
164+
```python
165+
options = {
166+
"connection": "google-oauth2",
167+
"authorization_params": {
168+
"redirect_uri": "http://localhost:3000/auth/callback",
169+
"audience": "urn:custom:api"
170+
}
171+
}
172+
unlink_user_url = await server_client.start_unlink_user(options, store_options=store_options)
173+
```
174+
175+
>[!NOTE]
176+
> Any `authorization_params` property specified when calling `start_unlink_user()` will override the same, statically configured, `authorization_params` property on `ServerClient`.
177+
178+
### Passing App State
179+
180+
The `app_state` parameter allows you to pass custom data (for example, a return URL) that will be returned when the unlinking process is complete.
181+
182+
```python
183+
options = {
184+
"connection": "google-oauth2",
185+
"app_state": {"return_to": "http://localhost:3000/profile"}
186+
}
187+
unlink_user_url = await server_client.start_unlink_user(options, store_options=store_options)
188+
189+
# Later, when completing unlinking:
190+
result = await server_client.complete_unlink_user(callback_url, store_options=store_options)
191+
print(result.get("app_state").get("return_to")) # Should output "http://localhost:3000/profile"
192+
```
193+
194+
### Passing Store Options
195+
196+
Every method that interacts with the state or transaction store accepts a second parameter, `store_options`. This parameter should include the HTTP request and response objects (or equivalents) needed to manage cookies or sessions.
197+
198+
```python
199+
store_options = {"request": request, "response": response}
200+
unlink_user_url = await server_client.start_unlink_user(options, store_options=store_options)
201+
```
202+
203+
Read more above in [Configuring the Transaction and State Store](./ConfigureStore.md).
204+
205+
## Complete Unlinking The User
206+
207+
After the user has been redirected back to your application (at the `redirect_uri`), you need to complete the unlinking process. This is done by calling `complete_unlink_user()`, which extracts the necessary parameters from the callback URL and returns the `app_state`.
208+
209+
```python
210+
# Complete the unlinking process:
211+
result = await server_client.complete_unlink_user(callback_url, store_options=store_options)
212+
213+
# Retrieve the app_state:
214+
print(result.get("app_state").get("return_to"))
215+
```
216+
217+
> [!NOTE]
218+
> The URL passed to `complete_unlink_user()` should be the full callback URL from Auth0, including the `state` and `code` parameters.
219+
220+
### Passing Store Options
221+
222+
Just like most methods, `complete_unlink_user()` accepts a second argument that is used to pass to the configured Transaction and State Store:
223+
224+
```python
225+
store_options = {"request": request, "response": response}
226+
result = await server_client.complete_unlink_user(callback_url, store_options=store_options)
227+
```
228+
229+
Read more above in [Configuring the Transaction and State Store](./ConfigureStore.md).

0 commit comments

Comments
 (0)