Guide home · Showcase endpoints
SMS uses a CIBA request to send a one-time code. Configure the provider server and a pvn_sms client with credentials and an authorized scope. The showcase asks for a normalized phone number; no client secret is sent to the browser.
- Browser calls showcase
POST /sms/authwithclient_id,server_id,login_hintandscope. - Showcase calls the provider's
/ext/ciba/authwithchannel=sms; on success it returnsauth_req_idandnonceto the browser. - User enters the OTP. Browser calls
POST /sms/tokenwithcode,auth_req_id,nonce,client_id, andserver_id. - Showcase submits the OTP to provider
/ext/bc/sms/callback, exchangesauth_req_idat/tokenwith the CIBA grant, and calls/userinfo. A successful response includes provider userinfo;/user/infouses the display session.
async function post(path, body) {
const response = await fetch(path, {
method: 'POST', headers: { 'Content-Type': 'application/json' },
credentials: 'same-origin', body: JSON.stringify(body),
});
if (!response.ok) throw new Error('SMS request failed');
return response.json();
}
const client_id = '<configured-client-id>', server_id = 'stage';
const attempt = await post('/sms/auth', {
client_id, server_id, login_hint: '+<country-code><number>',
scope: 'openid ip:phone_verify',
});
// Collect the code from the user; keep it out of logs.
const result = await post('/sms/token', {
client_id, server_id, auth_req_id: attempt.auth_req_id,
nonce: attempt.nonce, code: '<user-entered-otp>',
});These are showcase endpoints, not provider endpoints. The demo submits the provider callback on a best-effort basis and still attempts token exchange after callback failure; that is current behavior, not a general integration recommendation. Error responses are not always JSON (for example a missing client may return text), so production clients should handle both. The showcase can create a display session even on token failure; check the HTTP response and provider result, not session existence. If the code fails or expires, show a useful error and start a new attempt when necessary.
/sms/log is retained for compatibility. The browser flow no longer sends token responses to it. See browser SMS flow, CIBA service, and provider requests.