Skip to content

Commit 4a507df

Browse files
committed
Standardized mobile push notification code samples
1 parent 9b5c650 commit 4a507df

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

main/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow/mobile-push-notifications-with-ciba.mdx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ Once you have a user ID for the authorizing user, use the Authentication API or
5151
<Tabs><Tab title="cURL">
5252

5353
```bash lines
54-
curl --location 'https://$tenant.auth0.com/bc-authorize' \
54+
curl --location 'https://{yourDomain}.auth0.com/bc-authorize' \
5555
  --header 'Content-Type: application/x-www-form-urlencoded' \
56-
  --data-urlencode 'client_id=$client_id' \
57-
  --data-urlencode 'client_secret=$client_secret' \
58-
  --data-urlencode 'login_hint={ "format": "iss_sub", "iss": "https://$tenant.auth0.com/", "sub": "$user_id" }' \
59-
  --data-urlencode 'scope=$scope' \
60-
  --data-urlencode 'binding_message=$binding_message'
56+
  --data-urlencode 'client_id=<CLIENT_ID>' \
57+
  --data-urlencode 'client_secret=<CLIENT_SECRET>' \
58+
  --data-urlencode 'login_hint={ "format": "iss_sub", "iss": "https://{yourDomain}.auth0.com/", "sub": "<USER_ID>" }' \
59+
  --data-urlencode 'scope=<SCOPES>' \
60+
  --data-urlencode 'binding_message=<BINDING_MESSAGE>'
6161
```
6262

6363
</Tab><Tab title="C#">
@@ -66,15 +66,15 @@ curl --location 'https://$tenant.auth0.com/bc-authorize' \
6666
var response = await authenticationApiClient.ClientInitiatedBackchannelAuthorization(
6767
new ClientInitiatedBackchannelAuthorizationRequest()
6868
{
69-
ClientId = "your-client-id",
69+
ClientId = "<CLIENT_ID>",
7070
Scope = "openid",
71-
ClientSecret = "your-client-secret",
72-
BindingMessage = "your-binding-message",
71+
ClientSecret = "<CLIENT_SECRET>",
72+
BindingMessage = "<BINDING_MESSAGE>",
7373
LoginHint = new LoginHint()
7474
{
7575
Format = "iss_sub",
76-
Issuer = "your-issuer-domain",
77-
Subject = "auth0|user-id-here"
76+
Issuer = "https://{yourDomain}.auth0.com/",
77+
Subject = "<USER_ID>"
7878
}
7979
}
8080
);
@@ -89,10 +89,10 @@ resp, err := authAPI.CIBA.Initiate(context.Background(), ciba.Request{
8989
Scope: "openid",
9090
LoginHint: map[string]string{
9191
"format": "iss_sub",
92-
"iss": "your-issuer-domain",
93-
"sub": "auth0|user-id-here",
92+
"iss": "https://{yourDomain}.auth0.com/",
93+
"sub": "<USER_ID>",
9494
},
95-
BindingMessage: "TEST-BINDING-MESSAGE",
95+
BindingMessage: "<BINDING_MESSAGE>",
9696
})
9797
```
9898

@@ -105,10 +105,10 @@ AuthAPI auth = AuthAPI.newBuilder(domain, clientId, clientSecret).build();
105105
//Authorize
106106
Map<String, Object> loginHint = new HashMap<>();
107107
loginHint.put("format", "iss_sub");
108-
loginHint.put("iss", "your-issuer-domain");
109-
loginHint.put("sub", "auth0|user-id-here");
108+
loginHint.put("iss", "https://{yourDomain}.auth0.com/");
109+
loginHint.put("sub", "<USER_ID>");
110110

111-
Request<BackChannelAuthorizeResponse> request = auth.authorizeBackChannel("openid", "your-binding-message", loginHint);
111+
Request<BackChannelAuthorizeResponse> request = auth.authorizeBackChannel("openid", "<BINDING_MESSAGE>", loginHint);
112112

113113
BackChannelAuthorizeResponse resp = request.execute().getBody();
114114
```
@@ -187,9 +187,9 @@ Use the Authentication API or our [SDKs](/docs/libraries) to call the `/token` e
187187
```bash lines
188188
curl --location 'https://$tenant.auth0.com/oauth/token' \
189189
  --header 'Content-Type: application/x-www-form-urlencoded' \
190-
  --data-urlencode 'client_id=$client_id' \
191-
  --data-urlencode 'client_secret=$client_secret' \
192-
  --data-urlencode 'auth_req_id=$auth_req_id' \
190+
  --data-urlencode 'client_id=<CLIENT_ID>' \
191+
  --data-urlencode 'client_secret=<CLIENT_SECRET>' \
192+
  --data-urlencode 'auth_req_id=<AUTH_REQ_ID>' \
193193
  --data-urlencode 'grant_type=urn:openid:params:grant-type:ciba'
194194
```
195195

@@ -205,8 +205,8 @@ var token = await authenticationApiClient.GetTokenAsync(
205205
new ClientInitiatedBackchannelAuthorizationTokenRequest()
206206
{
207207
AuthRequestId = response.AuthRequestId,
208-
ClientId = "your-client-id",
209-
ClientSecret = "your-client-secret"
208+
ClientId = "<CLIENT_ID>",
209+
ClientSecret = "<CLIENT_SECRET>"
210210
}
211211
);
212212
```

0 commit comments

Comments
 (0)