Skip to Content
This project is in active development. Features and behaviors may change without notice.

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 before sauthbase.init().
  • Solution: Call sauthbase.init() during app startup before using .use().

Invalid token format.

  • Cause: The token passed to decrypt() or extractUserWithVerify() does not follow the iv: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

CodeDescription
SUCCESSOperation completed successfully.

❌ Error Responses

🔧 Internal Processing Errors

CodeDescription
ERROR/INTERNALA general internal processing error occurred.
ERROR/INTERNAL_HMAC_CALCULATIONError occurred during HMAC calculation.
ERROR/INTERNAL_DECRYPTIONError occurred during decryption.
ERROR/INTERNAL_VERIFICATIONInternal error during session verification.
ERROR/INTERNAL_TOKEN_GENERATIONError occurred during token generation.
ERROR/INTERNAL_ENCRYPTION_FAILUREError occurred during encryption.
ERROR/INTERNAL_HMAC_FAILUREHMAC generation failed.
ERROR/INTERNAL_HMAC_ERRORUnexpected HMAC-related error occurred.

⚠️ Invalid or Missing Arguments

CodeDescription
ERROR/ARGUMENT_REQUIRED_SESSIONRequired session argument was not provided.
ERROR/ARGUMENT_REQUIRED_USERNAMERequired username was not provided.
ERROR/ARGUMENT_REQUIRED_TOKENRequired token was not provided.

📦 Data Retrieval & Format Issues

CodeDescription
ERROR/FETCH_FAILEDFailed to fetch data.
ERROR/FORMAT_INVALID_TOKENToken format is invalid.
ERROR/DECRYPTION_FAILUREDecryption failed.
ERROR/HMAC_MISMATCHHMAC verification failed (possible tampering).

Support

If your issue persists, please report it on the GitHub Issues page.

Last updated on