Troubleshooting
This page lists common issues when using SAuthBase, along with solutions and a complete reference of all response codes (code
).
Common Issues and Solutions
SAuthBase has not been initialized.
- Cause:
sauthbase.use()
was called beforesauthbase.init()
. - Solution: Call
sauthbase.init()
during app startup before using.use()
.
Invalid token format.
- Cause: The token passed to
decrypt()
orextractUserWithVerify()
does not follow theiv:encrypted:authTag
format. - Solution: Ensure the token is correctly generated and check your encryption process.
Response Code Reference
Below is a list of response codes returned by the SAuthBase SDK.
The code
field categorizes the response type concisely, while message
provides details.
✅ Success Responses
Code | Description |
---|---|
SUCCESS | Operation completed successfully. |
❌ Error Responses
🔧 Internal Processing Errors
Code | Description |
---|---|
ERROR/INTERNAL | A general internal processing error occurred. |
ERROR/INTERNAL_HMAC_CALCULATION | Error occurred during HMAC calculation. |
ERROR/INTERNAL_DECRYPTION | Error occurred during decryption. |
ERROR/INTERNAL_VERIFICATION | Internal error during session verification. |
ERROR/INTERNAL_TOKEN_GENERATION | Error occurred during token generation. |
ERROR/INTERNAL_ENCRYPTION_FAILURE | Error occurred during encryption. |
ERROR/INTERNAL_HMAC_FAILURE | HMAC generation failed. |
ERROR/INTERNAL_HMAC_ERROR | Unexpected HMAC-related error occurred. |
⚠️ Invalid or Missing Arguments
Code | Description |
---|---|
ERROR/ARGUMENT_REQUIRED_SESSION | Required session argument was not provided. |
ERROR/ARGUMENT_REQUIRED_USERNAME | Required username was not provided. |
ERROR/ARGUMENT_REQUIRED_TOKEN | Required token was not provided. |
📦 Data Retrieval & Format Issues
Code | Description |
---|---|
ERROR/FETCH_FAILED | Failed to fetch data. |
ERROR/FORMAT_INVALID_TOKEN | Token format is invalid. |
ERROR/DECRYPTION_FAILURE | Decryption failed. |
ERROR/HMAC_MISMATCH | HMAC verification failed (possible tampering). |
Support
If your issue persists, please report it on the GitHub Issues page .
Last updated on