b2c-slas-auth-patterns
БесплатноБез исполняемых скриптовНе проверенImplement SLAS authentication patterns in B2C Commerce including passwordless login (email OTP, SMS OTP, passkeys), session bridging between PWA…
от SalesforceCommerceCloud★ 58 звёзд на GitHubОб этом скилле
B2C SLAS Authentication Patterns
Advanced authentication patterns for SLAS (Shopper Login and API Access Service) beyond basic login. These patterns enable passwordless authentication, hybrid storefront support, and system-to-system integration.
Scope & grounding
This skill covers SLAS authentication patterns including passwordless login (email OTP, SMS, passkeys), session bridging, hybrid authentication (B2C 25.3+), token management, TSOB, and JWT validation with framework-specific examples for PWA Kit, Storefront Next, and SFRA. Code examples are illustrative of typical flows. Before answering version-specific questions, framework-specific implementations, or providing code the user will run in production, confirm current API contracts, parameters, rate limits, and version requirements against the official documentation via b2c docs search and b2c docs read. The canonical docs are the authoritative source for B2C platform specifics, API shapes, and configuration requirements.
Canonical docs
commerce-api/slas- SLAS overviewcommerce-api/slas-best-practices- Security and implementation best practicescommerce-api/slas-passwordless-login-overview- Passwordless authentication overviewcommerce-api/slas-passwordless-login-email- Email OTP implementationcommerce-api/slas-passwordless-login-passkey- Passkey/WebAuthn implementationcommerce-api/slas-passwordless-sms- SMS OTP implementationcommerce-api/slas-session-bridge-overview- Session bridge overviewcommerce-api/slas-session-bridge-auth- Session bridge implementationcommerce-api/hybrid-authentication- Hybrid authentication (B2C 25.3+)commerce-api/hybrid-auth-pwa-kit-v2- PWA Kit v2 hybrid authpwa-kit-managed-runtime/hybrid-auth- PWA Kit managed runtime hybrid authpwa-kit-managed-runtime/plugin-slas-setup- Plugin SLAS setupcommerce-api/slas-trusted-system- Trusted system on behalf (TSOB)commerce-api/slas-public-client- Public client configurationcommerce-api/slas-private-client- Private client configurationcommerce-api/slas-validate-jwt-with-jwks- JWT validation
Authentication Methods Overview
| Method | Use Case | User Experience |
|---|---|---|
| Password | Traditional login | Username + password form |
| Email OTP | Passwordless email | Code sent to email |
| SMS OTP | Passwordless SMS | Code sent to phone |
| Passkeys | FIDO2/WebAuthn | Biometric or device PIN |
| Session Bridge | Hybrid storefronts | Seamless PWA ↔ SFRA |
| Hybrid Auth | B2C 25.3+ | Built-in platform auth sync |
| TSOB | System integration | Backend service calls |
Passwordless Email OTP
Illustrative of the flow; confirm current API shape, parameters, and rate limits with
b2c docs read commerce-api/slas-passwordless-login-emailandb2c docs read commerce-api/slas-passwordless-login-overview.
Send one-time passwords via email for passwordless login.
Flow Overview
- Call
/oauth2/passwordless/loginwith callback URI - SLAS POSTs
pwdless_login_tokento your callback - Your app sends OTP to shopper via email
- Shopper enters OTP, app exchanges for tokens
Step 1: Initiate Passwordless Login
// POST /shopper/auth/v1/organizations/{org}/oauth2/passwordless/login
async function initiatePasswordlessLogin(email, siteId) {
const response = await fetch(
`https://${shortCode}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/${orgId}/oauth2/passwordless/login`,
{
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
user_id: email,
mode: 'callback',
channel_id: siteId,
callback_uri: 'https://yoursite.com/api/passwordless/callback'
})
}
);
// SLAS will POST to your callback_uri with pwdless_login_token
return response.json();
}
Step 2: Handle Callback and Send OTP
Your callback endpoint receives pwdless_login_token. Generate an OTP and send it to the user:
// Your callback endpoint (receives POST from SLAS)
app.post('/api/passwordless/callback', async (req, res) => {
const { pwdless_login_token, user_id } = req.body;
// Generate 6-digit OTP
const otp = Math.floor(100000 + Math.random() * 900000).toString();
// Store token + OTP mapping (e.g., Redis with 10 min TTL)
await redis.setex(`pwdless:${otp}`, 600, JSON.stringify({
token: pwdless_login_token,
email: user_id
}));
// Send OTP via email (configure in SLAS Admin UI)
await sendOTPEmail(user_id, otp);
res.status(200).send('OK');
});
Step 3: Exchange OTP for Tokens
// POST /shopper/auth/v1/organizations/{org}/oauth2/passwordless/token
async function exchangeOTPForToken(otp, clientId, clientSecret, siteId) {
// Retriev
Установить b2c-slas-auth-patterns в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл b2c-slas-auth-patterns?
Implement SLAS authentication patterns in B2C Commerce including passwordless login (email OTP, SMS OTP, passkeys), session bridging between PWA Kit/Storefront Next and SFRA, hybrid authentication (B2C 25.3+), token refresh flows, trusted system on behalf of (TSOB), and JWT validation. Use this skill whenever the user asks about shopper authentication beyond basic login, token exchange flows, passwordless or biometric auth, keeping sessions alive across storefronts, handling 409 Conflict errors on token endpoints, refreshing shopper tokens, or validating JWTs — even if they don't mention SLAS by name.
Как установить скилл b2c-slas-auth-patterns?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл b2c-slas-auth-patterns запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic