Skip to main content
FreshCreditFreshCredit®INC
محصولاتراه‌حل‌هاطرح‌هاشرکتتماس
اجرای برنامه
Documentation / Authentication /

Authentication

OAuth 2.0 flows, API key management, webhook signatures, JWT handling, and security best practices for production.

روش‌های احراز هویت /

API Key Authentication

Use API keys for server-to-server authentication. Include your key in the Authorization header with Bearer prefix.

// Request header
Authorization: Bearer fc_live_xxxxxxxxxxxxxxxx

// Generate HMAC signature
const crypto = require('crypto');
const signature = crypto
  .createHmac('sha256', API_SECRET)
  .update(timestamp + method + path + body)
  .digest('hex');

// Include signature header
X-FreshCredit-Signature: {signature}
X-FreshCredit-Timestamp: {unix_timestamp}

OAuth 2.0

For user-delegated access, use OAuth 2.0 authorization code flow. Users authorize your application to access their FreshCredit data.

// Step 1: Redirect user to authorization endpoint
https://app.freshcredit.com/oauth/authorize?
  response_type=code&
  client_id=your_client_id&
  redirect_uri=https://your-app.com/callback&
  scope=blockid:read blockscore:read&
  state=random_state_string

// Step 2: Exchange code for access token
POST https://api.freshcredit.com/v1/oauth/token
{
  "grant_type": "authorization_code",
  "code": "auth_code_from_callback",
  "client_id": "your_client_id",
  "client_secret": "your_client_secret",
  "redirect_uri": "https://your-app.com/callback"
}
Scopes OAuth /
blockid:readRead identity verification status and credentials
blockid:writeInitiate identity verification workflows
blockscore:readRead credit scores and model outputs
blockscore:writeCreate and update custom credit models
blockiq:readRead offer matching data and marketplace info
blockiq:writeCreate and manage offers
wallet:readRead user's self-custody wallet data
webhooksConfigure and manage webhook endpoints
امنیت Webhook /

Webhook Signature Verification

All webhooks include a signature header. Verify signatures to ensure requests originate from FreshCredit.

const crypto = require('crypto');

function verifyWebhookSignature(payload, signature, secret) {
  const expected = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');
  
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

// In your webhook handler
app.post('/webhooks/freshcredit', (req, res) => {
  const signature = req.headers['x-freshcredit-signature'];
  const payload = JSON.stringify(req.body);
  
  if (!verifyWebhookSignature(payload, signature, WEBHOOK_SECRET)) {
    return res.status(401).send('Invalid signature');
  }
  
  // Process webhook
  handleWebhook(req.body);
  res.status(200).send('OK');
});
بهترین شیوه‌های امنیتی /

Store Credentials Securely

Never expose API secrets in client-side code. Use environment variables and secret management systems like AWS Secrets Manager or HashiCorp Vault.

Rotate Keys Regularly

Rotate API keys every 90 days. FreshCredit supports multiple active keys for zero-downtime rotation.

Use HTTPS Only

All API requests must use HTTPS. Unencrypted HTTP requests are rejected.

گام‌های بعدی

کاوش BlockID™دانلود SDKها
FreshCreditFreshCredit®INC

زیرساخت اعتبار و هویت برای دنیای مدرن.

INC freshcredit.comLAB freshcredit.xyzORG freshcredit.orgDAO freshcredit.aiAPP freshcredit.app

Stay Updated

Get fraud prevention insights and product updates. Unsubscribe anytime.

محصولات
جریان‌های کاری BlockID™مدل‌های BlockScore™پیشنهادات BlockIQ™برنامه‌ی FreshCredit™
شرکت
درباره‌ی ماطرح‌هامستنداتتماس
اکوسیستم
The FreshCredit® LabThe FreshCredit® OrgThe FreshCredit® DAOبرنامه‌ی FreshCredit™
ماشین‌حساب‌ها
ماشین‌حساب هزینه‌ی ارائه‌دهندهماشین‌حساب هزینه‌ی مصرف‌کنندهماشین‌حساب هزینه‌ی توسعه‌دهندهماشین‌حساب هزینه‌ی اقتصادی
حقوقی
سیاست حریم خصوصیشرایط خدماتسیاست AML/KYCسیاست کوکی
XInstagramRedditGitHubYouTubeFacebook

© 2026 FreshCredit® Inc. تمام حقوق محفوظ است.

FreshCredit® Inc بانک، اتحادیه‌ی اعتباری، شرکت تعمیر اعتباری یا آژانس گزارش‌دهی اعتباری (CRA) نیست. FreshCredit® تصمیمات وام‌دهی، تمدید اعتبار، تضمین نتایج اعتباری یا ارائه‌ی مشاوره‌ی مالی انجام نمی‌دهد. اکوسیستم FreshCredit™ زیرساختی فراهم می‌کند که به ارائه‌دهندگان شخص ثالث امکان می‌دهد محصولات اعتباری و هویتی بسازند. BlockID™، BlockScore™، BlockIQ™ و برنامه‌ی FreshCredit™ علائم تجاری FreshCredit® Inc هستند. همه‌ی تصمیمات اعتباری توسط ارائه‌دهندگانی گرفته می‌شود که روی پلتفرم FreshCredit® می‌سازند.