Skip to content

Commit 10206d6

Browse files
Merge pull request #6044 from VihangaMunasinghe/push-tenant-org-path-support
Update push authentication endpoint building instructions in build push auth app docs
2 parents a5b3d43 + c3063d7 commit 10206d6

1 file changed

Lines changed: 65 additions & 3 deletions

File tree

en/includes/references/tutorials/build-your-own-push-authenticator-app.md

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,24 @@ The data sent through the push notification contains the following information:
335335
<td><code>username</code></td>
336336
<td>Username of the user trying to authenticate.</td>
337337
</tr>
338+
339+
{% if product_name == "Asgardeo" or (product_name == "WSO2 Identity Server" and is_version > "7.2.0") %}
340+
341+
<tr>
342+
<td><code>relativePath</code></td>
343+
<td>
344+
The resolved relative path to build the authentication API endpoint.<br/>
345+
Possible relative paths:
346+
<ol>
347+
<li>/t/{tenant-domain}</li>
348+
<li>/o/{organization-id}</li>
349+
<li>/t/{tenant-domain}/o/{organization-id}</li>
350+
</ol>
351+
</td>
352+
</tr>
353+
354+
{% endif %}
355+
338356
<tr>
339357
<td><code>tenantDomain</code></td>
340358
<td>Tenant domain of the root organization user (tenant user).</td>
@@ -389,10 +407,16 @@ The data sent through the push notification contains the following information:
389407
</tr>
390408
</table>
391409

410+
{% if product_name == "Asgardeo" or (product_name == "WSO2 Identity Server" and is_version > "7.2.0") %}
411+
412+
{% else %}
413+
392414
!!! note
393415
- For a root organization user (tenant user), only the **tenantDomain** will be available in the push notification data.
394416
- For an organization user, only **organizationId** and **organizationName** will be available in the push notification data.
395417

418+
{% endif %}
419+
396420
With the above information, the push authenticator app should display the authentication request information to the user.
397421
The user should be able to approve or deny the authentication request based on the information displayed.
398422

@@ -445,6 +469,40 @@ The JWT token should contain the following claims in the payload:
445469
</tr>
446470
</table>
447471

472+
{% if product_name == "Asgardeo" or (product_name == "WSO2 Identity Server" and is_version > "7.2.0") %}
473+
474+
Based on the notification data, the authentication API endpoint should be conditionally invoked with a **tenanted path**, an **organization path**, or a **tenant qualified organization aware path** by the push authenticator app. Either of the following methods can be used to build the authentication API endpoint.
475+
476+
### Option 1: Use relative path from notification data
477+
478+
The user information contains the resolved **relative path** to build the correct API endpoint. Invoke the authentication API with the **relative path** as shown below.
479+
480+
```text
481+
{{baseUrl}}/{relative-path}/push-auth/authenticate
482+
```
483+
484+
### Option 2: Build full endpoint
485+
486+
1. If the user information contains the **tenant domain**, the authentication API should be invoked with the **tenanted path** as shown below.
487+
488+
```text
489+
{{baseUrl}}/t/{tenant-domain}/push-auth/authenticate
490+
```
491+
492+
2. If the user information contains the **organization ID**, the authentication API should be invoked with the **organization path**.
493+
494+
```text
495+
{{baseUrl}}/o/{organization-id}/push-auth/authenticate
496+
```
497+
498+
3. If the user information contains both the **tenant domain** and the **organization ID**, the authentication API should be invoked with the **tenant qualified organization aware path**.
499+
500+
```text
501+
{{baseUrl}}/t/{tenant-domain}/o/{organization-id}/push-auth/authenticate
502+
```
503+
504+
{% else %}
505+
448506
According to the stored user information, the push authenticator app should conditionally invoke the relevant API authenticate endpoint with a **tenanted path** or an **organization path**.
449507
450508
If the user information contains the **tenant domain**, the authentication API should be invoked with the **tenanted path** as shown below.
@@ -455,11 +513,15 @@ If the user information contains the **organization ID**, the authentication API
455513
456514
{{baseUrl}}/o/{organization-id}/push-auth/authenticate
457515
516+
{% endif %}
517+
458518
The below given is a sample request payload to be sent to the authentication API.
459519
460-
{
461-
"authResponse": <JWT token>
462-
}
520+
```json
521+
{
522+
"authResponse": "<JWT token>"
523+
}
524+
```
463525

464526
Once the authentication request is sent successfully, the push authenticator app will receive a **202 Accepted** response. With that, the authentication flow
465527
will be continued and the user will be authenticated based on the response sent by the push authenticator app.

0 commit comments

Comments
 (0)