Skip to content

Commit c4cba3c

Browse files
authored
Added backchannel login (#10482)
* Added backchannel login * Updated backchannel login * Cleaned up PR * updated link and other minor updates * Removed bullet point * Addressed docs team review * Updated link * Created back-channel-login sidebar * Added back back-channel-login to login page * Revert "Created back-channel-login sidebar" This reverts commit 6d4e5d0. Reverting commit adding back-channel login to sidebar * Added back-channel login to end
1 parent 0d50790 commit c4cba3c

File tree

1 file changed

+168
-1
lines changed

1 file changed

+168
-1
lines changed

Diff for: articles/api/authentication/_login.md

+168-1
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,171 @@ Make a `GET` call to the `/authorize` endpoint for passive authentication. It re
203203
- [SAML](/protocols/saml)
204204
- [Obtain a Client Id and Client Secret for Microsoft Azure Active Directory](/connections/enterprise/azure-active-directory)
205205
- [State Parameter](/protocols/oauth2/oauth-state)
206-
- [Auth0.js /authorize Method Reference](/libraries/auth0js#webauth-authorize-)
206+
- [Auth0.js /authorize Method Reference](/libraries/auth0js#webauth-authorize-)
207+
208+
## Back-Channel Login
209+
210+
:::note
211+
This feature is currently in Early Access. To request access, contact your Technical Account Manager.
212+
:::
213+
214+
The Back-Channel Login endpoint enables applications to send an authentication request to a user’s phone, or the authentication device, provided they have an app installed and are enrolled for [push notifications using the Guardian SDK](/secure/multi-factor-authentication/auth0-guardian#enroll-in-push-notifications).
215+
216+
Use the Back-Channel Login endpoint to authenticate users for the following use cases:
217+
218+
- Users are not in front of the application that requires authentication, such as when they're telephoning a call center.
219+
- The consumption device, or the device that helps the user consume a service, is insecure for sensitive operations e.g. web browser for financial transactions.
220+
- The consumption device has limited interactive capability e.g. e-bicycles or e-scooters.
221+
222+
<%= include('../../_includes/_http-method', {
223+
"http_badge": "badge-primary",
224+
"http_method": "POST",
225+
"path": "/bc-authorize",
226+
"link": "#back-channel-login"
227+
}) %>
228+
229+
```http
230+
curl --location 'https://[TENANT_DOMAIN]/bc-authorize' \
231+
--header 'Content-Type: application/x-www-form-urlencoded' \
232+
--data-urlencode 'client_id=[CLIENT ID]' \
233+
--data-urlencode 'client_secret=[CLIENT SECRET]' \
234+
--data-urlencode 'binding_message=[YOUR BINDING MESSAGE]' \
235+
--data-urlencode 'login_hint={ "format": "iss_sub", "iss":
236+
"https://[TENANT].auth0.com/", "sub": "auth0|[USER ID]" }' \
237+
--data-urlencode 'scope=openid'
238+
```
239+
240+
### Request Parameters
241+
242+
| Parameter | Description |
243+
|:-----------------|:------------|
244+
| `client_id` <br/><span class="label label-danger">Required</span> | Client ID of your application. |
245+
| `binding_message` <br/><span class="label label-danger">Required</span> | Human-readable string displayed on both the device calling `/bc-authorize` and the user’s authentication device (e.g. phone) to ensure the user is approves the correct request. For example: `ABC-123-XYZ`. |
246+
| `login_hint` <br/><span class="label label-danger">Required</span> | String containing information about the user to contact for authentication. It uses the [IETF9493 standard for Subject Identifiers for Security Event Tokens](https://datatracker.ietf.org/doc/html/rfc9493). Auth0 only supports the [Issuer and Identifier format](https://datatracker.ietf.org/doc/html/rfc9493#name-issuer-and-subject-identifi). For an example login hint, review the [Remarks](#remarks). |
247+
| `scope` <br/><span class="label label-danger">Required</span> | Space-separated list of OIDC and custom API scopes. For example: `openid read:timesheets edit:timesheets`. Include `offline_access` to get a refresh token. At a minimum, you must include the scope `openid`. |
248+
| `audience` <br/><span class="label label-danger">Optional</span> | Unique identifier of the audience for an issued token. If you require an access token for an API, pass the unique identifier of the target API you want to access. |
249+
| `request_expiry` <br/><span class="label label-danger">Optional</span> | To configure a custom expiry time in seconds for this request, pass a number between 1 and 300. If not provided, expiry defaults to 300 seconds. |
250+
251+
### Response Body
252+
253+
If the request is successful, you should receive a response like the following:
254+
255+
```http
256+
{
257+
"auth_req_id": "eyJh...",
258+
"expires_in": 300,
259+
"interval": 5
260+
}
261+
```
262+
263+
The `auth_req_id` value should be kept as it is used later in the flow to identify the authentication request.
264+
265+
The `expires_in` value tells you how many seconds you have until the authentication request expires.
266+
267+
The `interval` value tells you how many seconds you must wait between poll requests.
268+
269+
The request should be approved or rejected on the user’s authentication device using the Guardian SDK.
270+
271+
### Remarks
272+
273+
The following code sample is an example login hint:
274+
275+
```http
276+
{
277+
"format": "iss_sub",
278+
"iss": "https://[TENANT_DOMAIN]/",
279+
"sub": "auth0|[USER ID]"
280+
}
281+
```
282+
283+
White space is not significant. Replace the `[TENANT_DOMAIN]` with your tenant domain or custom domain. Replace the `[USER ID]` with a valid `user_id` for the authorizing user returned from the [User Search APIs](https://auth0.com/docs/manage-users/user-search).
284+
285+
Include an optional parameter for application authentication in the request:
286+
287+
- Client Secret with HTTP Basic auth, in which case no parameters are required. The `client_id` and `client_secret` are passed in a header.
288+
- Client Secret Post, in which case the `client_id` and `client_secret` are required.
289+
- Private Key JWT, where the `client_id`, `client_assertion` and `client_assertion` type are required.
290+
- mTLS, where the `client_id` parameter is required and the `client-certificate` and `client-certificate-ca-verified` headers are required.
291+
292+
<%= include('../../_includes/_http-method', {
293+
"http_badge": "badge-primary",
294+
"http_method": "POST",
295+
"path": "/oauth/token",
296+
"link": "#post-token"
297+
}) %>
298+
299+
```http
300+
curl --location 'https://[TENANT_DOMAIN]/oauth/token' \
301+
--header 'Content-Type: application/x-www-form-urlencoded' \
302+
--data-urlencode 'client_id=[CLIENT ID]' \
303+
--data-urlencode 'client_secret=[CLIENT SECRET]' \
304+
--data-urlencode 'auth_req_id=[FROM THE BC-AUTHORIZE RESPONSE]' \
305+
--data-urlencode 'grant_type=urn:openid:params:grant-type:ciba'
306+
```
307+
308+
To check on the status of a Back-Channel Login flow, poll the `/oauth/token` endpoint at regular intervals by passing the following:
309+
310+
- `auth_req_id` returned from the call to `/bc-authorize`
311+
- `urn:openid:params:grant-type:ciba` grant type
312+
313+
### Request Parameters
314+
315+
| Parameter | Description |
316+
|:-----------------|:------------|
317+
| `client_id` <br/><span class="label label-danger">Required</span> | Client ID of your application |
318+
| `auth_req_id` <br/><span class="label label-danger">Required</span> | Used to reference the authentication request. Returned from the call to `/bc-authorize` |
319+
| `grant_type` <br/><span class="label label-danger">Required</span> | Must be set to `urn:openid:params:grant-type:ciba` |
320+
321+
### Response Body
322+
323+
If the authorizing user has not yet approved or rejected the request, you should receive a response like the following:
324+
325+
```http
326+
{
327+
"error": "authorization_pending",
328+
"error_description": "The end-user authorization is pending"
329+
}
330+
```
331+
332+
If the authorizing user rejects the request, you should receive a response like the following:
333+
334+
```http
335+
{
336+
"error": "access_denied",
337+
"error_description": "The end-user denied the authorization request or it
338+
has been expired"
339+
}
340+
```
341+
342+
If you are polling too quickly (faster than the interval value returned from `/bc-authorize`), you should receive a response like the following:
343+
344+
```http
345+
{
346+
"error": "slow_down",
347+
"error_description": "You are polling faster than allowed. Try again in 10 seconds."
348+
}
349+
```
350+
351+
In addition, Auth0 will add the the [Retry-After](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header to the response indicating how many seconds to wait before attempting to poll again. If you consistently poll too frequently, the number of seconds you must wait increases.
352+
353+
If the authorizing user has approved the push notification, the call returns the ID token and access token (and potentially a refresh token):
354+
355+
```http
356+
{
357+
"access_token": "eyJh...",
358+
"id_token": "eyJh...",
359+
"expires_in": 86400,
360+
"scope": "openid"
361+
}
362+
```
363+
364+
Once you have exchanged an `auth_req_id` for an ID or access token, it is no longer usable.
365+
366+
### Remarks
367+
368+
Include an optional parameter for application authentication in the request:
369+
370+
- Client Secret with HTTP Basic auth, in which case no parameters are required. The `client_id` and `client_secret` are passed in a header.
371+
- Client Secret Post, in which case the `client_id` and `client_secret` are required.
372+
- Private Key JWT, where the `client_id`, `client_assertion` and `client_assertion` type are required.
373+
- mTLS, where the `client_id` parameter is required and the `client-certificate` and `client-certificate-ca-verified` headers are required.

0 commit comments

Comments
 (0)