-
Notifications
You must be signed in to change notification settings - Fork 1
Authentication
Daniel Heward-Mills edited this page Sep 27, 2025
·
1 revision
SPARQLWorks™ supports multiple authentication methods for accessing protected SPARQL endpoints. This document explains how to configure and use OAuth 2.0 and Bearer token authentication.
Modern, secure authentication using industry standards:
- PKCE Flow: Proof Key for Code Exchange for enhanced security
- Dynamic Registration: Automatic client registration for compatible servers
- Token Refresh: Automatic token renewal (when supported)
- Standards Compliant: OAuth 2.0 Authorization Code flow
Direct token authentication for simple setups:
- Manual Entry: Direct input of access tokens
- No Expiry Handling: Manual token renewal required
- Simple Configuration: Minimal setup required
- SPARQL Endpoint: Must support OAuth 2.0
- Client Registration: Endpoint must allow client registration or provide client credentials
- HTTPS Required: OAuth requires secure connections
- Redirect URI: Must be configured on the authorization server
- Open SPARQLWorks in your browser
- Enter your OAuth-enabled SPARQL endpoint URL
- Example:
https://sparql.example.com/sparql
- Click the account icon (👤) in the top-right corner
- The account menu will appear
- Click "OAuth Settings" to configure OAuth parameters
-
Client ID (optional):
- Enter if provided by your endpoint administrator
- Leave empty for dynamic registration
- Example:
sparql-client-123
-
Redirect URI:
- Usually auto-configured to current page URL
- Must be HTTPS in production
- Must be registered with the OAuth server
- Example:
https://sparqlworks.example.com/
- Click "Log In" from the account menu
- You'll be redirected to your endpoint's login page
- Enter your credentials
- Grant permission for SPARQLWorks to access the endpoint
- You'll be redirected back to SPARQLWorks
- Account icon shows "Signed in (OAuth)"
- Status message confirms successful authentication
- Queries now include Authorization headers automatically
- Simple Endpoints: Endpoints with basic token authentication
- API Keys: Direct token provision
- Development: Quick authentication for testing
- Legacy Systems: Older authentication methods
- Contact your endpoint administrator
- Request a bearer token or API key
- Ensure the token has appropriate permissions
- Click the account icon (👤)
- Select "Provide Bearer token"
- Paste your token in the text area
- Example token:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
- Click "Save & Authenticate"
- SPARQLWorks validates the token
- Success message appears
- Account status updates to "Signed in (Bearer token)"
SPARQLWorks validates credentials by:
- HEAD/OPTIONS Request: Testing endpoint accessibility
- Authorization Header: Including Bearer token
- Status Code Check: Verifying 200/401/403 responses
- Error Handling: Providing clear feedback
-
Success:
"Credentials stored (OAuth/Bearer). Queries will include Authorization headers." - Warning: Token accepted but validation inconclusive
- Error: Token rejected by endpoint
- OpenID Connect: Full OAuth/OIDC support
- Custom OAuth: Standard OAuth 2.0 implementations
- Enterprise Systems: Corporate authentication servers
- Cloud Services: AWS Cognito, Azure AD, etc.
- API Gateways: Services with token authentication
- Custom Endpoints: Proprietary authentication schemes
- Legacy Systems: Older SPARQL implementations
- Authorization Code: Received after user login
- Token Exchange: Code exchanged for access token
- Storage: Token stored in browser localStorage
- Automatic Inclusion: Added to all SPARQL requests
- Expiry Handling: Tokens expire based on server configuration
- Manual Entry: User provides token directly
- Storage: Token stored securely in localStorage
- No Expiry: No automatic renewal
- Manual Refresh: User must update expired tokens
- HTTPS Only: All authentication requires secure connections
- Local Storage: Credentials stored client-side only
- No Server Transmission: SPARQLWorks never sends credentials to its own servers
- Session Isolation: Credentials isolated per browser session
- Verify endpoint supports OAuth 2.0
- Check discovery document availability
- Confirm CORS configuration
- Server may require manual client registration
- Contact administrator for client credentials
- Use manual client ID configuration
- Ensure redirect URI matches OAuth server configuration
- Check for HTTPS requirement
- Verify exact URI matching
- Browser security restrictions
- Clear browser cache and retry
- Check for browser extensions interfering
- Verify token format and validity
- Check token permissions
- Confirm token hasn't expired
- Endpoint doesn't allow browser requests
- May need proxy or server-side implementation
- Check endpoint CORS policy
- Ensure token is properly formatted
- Check for extra whitespace
- Verify base64 encoding if applicable
// In browser console
localStorage.removeItem('oauthAccessToken');
localStorage.removeItem('sparqlworks.auth.source');
location.reload();// Clear all OAuth data
localStorage.removeItem('pkce_verifier');
localStorage.removeItem('oauth_state_nonce');
localStorage.removeItem('oauth_client_id');
localStorage.removeItem('oauth_origin');// Test basic connectivity
fetch('https://your-endpoint.com/sparql', {
method: 'HEAD',
headers: { 'Authorization': 'Bearer YOUR_TOKEN' }
}).then(r => console.log('Status:', r.status));- PKCE Always: Proof Key for Code Exchange prevents code interception
- State Parameter: Prevents CSRF attacks
- HTTPS Required: Prevents token interception
- Short Token Lifetime: Reduces exposure window
- Secure Storage: Browser localStorage with same-origin policy
- No Logging: Tokens never logged or displayed
- Manual Handling: User responsible for token security
- Regular Rotation: Update tokens periodically
- No Credential Transmission: SPARQLWorks never sends credentials to external servers
- Client-Side Only: All authentication handled in browser
- Session Isolation: Credentials isolated per origin
- Automatic Cleanup: Failed authentication clears stored tokens
For endpoints with non-standard OAuth configuration:
- Manual Discovery: Configure custom endpoints if auto-discovery fails
- Client Credentials: Use pre-registered client IDs
- Custom Scopes: Specify required OAuth scopes
- Token Refresh: Configure refresh token handling
For endpoints behind authentication proxies:
- Proxy Configuration: Configure proxy settings if needed
- Header Forwarding: Ensure Authorization headers pass through
- CORS Handling: Configure CORS for proxy scenarios
For corporate environments:
- SSO Integration: Configure with corporate identity providers
- Multi-Factor Authentication: Support MFA when available
- Compliance: Meet enterprise security requirements
- Audit Logging: Enable authentication auditing
- Documentation: Check endpoint-specific authentication docs
- Administrator: Contact your SPARQL endpoint administrator
- Community: Check SPARQLWorks issue tracker
- Logs: Use browser developer tools for detailed error information
When reporting authentication issues, include:
- Endpoint URL
- Authentication method (OAuth/Bearer)
- Browser and version
- Error messages
- Network request details