Step 1: Obtain Client Credentials
You need to have the following client credentials:client_id
client_secret
Step 2: Generate an OAuth Token
To generate an OAuth token, you need to make a POST request to the/oauth/token
endpoint with your client credentials. The request body should include the following parameters:
client_id
: Your client ID.client_secret
: Your client secret.scope
: The scopes you want to request access to. Available scopes includeread:builders
,read:subcontractors
,read:prequalifications
,read:insurances
,read:contacts
,read:swms
,read:timesheets
.audience
: The audience for the token. This should be set tohttps://api.buildpass.global
.grant_type
: The grant type you want to use. This should be set toclient_credentials
.
API reference
Check out the API reference for our OAuth2 token endpoint.
Example Request
Alternative: HTTP Basic Authentication
You can also provide client credentials via HTTP Basic Authentication instead of the request body:Form Data Support
The endpoint also supportsapplication/x-www-form-urlencoded
content type:
Response Format
The token response follows OAuth 2.0 standards:Error Responses
Error responses follow OAuth 2.0 RFC 6749 standards:invalid_request
: Missing or malformed request parametersinvalid_client
: Invalid client credentialsinvalid_scope
: Requested scopes are invalid for the audienceunsupported_grant_type
: Grant type not supported
Step 3: Use the Access Token
Once you have the access token, include it in the Authorization header of your API requests as a Bearer token.Example Authorization Header
OAuth 2.0 Compliance Features
Our implementation is fully compliant with OAuth 2.0 standards:RFC 6749 - OAuth 2.0 Authorization Framework
- ✅ Client Credentials Grant (Section 4.4)
- ✅ Standard Token Response Format (Section 5.1)
- ✅ Standard Error Response Format (Section 5.2)
- ✅ Client Authentication Methods (Section 2.3.1)
RFC 6750 - Bearer Token Usage
- ✅ Authorization Request Header Field (Section 2.1)
- ✅ Cache Control Headers (Section 3)
Additional Security Features
- ✅ JWT Access Tokens with HMAC-SHA256 signing
- ✅ Unique Token IDs (jti claim) for token tracking
- ✅ Encrypted Client Secret Storage
- ✅ Audience-Specific Scope Validation
- ✅ Comprehensive Audit Logging
Token Management
- Token Lifetime: 1 hour (3600 seconds)
- Token Format: JSON Web Token (JWT)
- Signing Algorithm: HMAC-SHA256
- Security Headers: Cache-Control: no-store, Pragma: no-cache