Skip to content

Additional Exception Handling for Restricted Environments #170

@shitalavhad734

Description

@shitalavhad734

Describe the bug
When running Password4j in restricted Java environments (such as those with a strict SecurityManager or limited file access permissions), the library may throw exceptions during static initialization or while attempting to load the psw4j.properties configuration file. This makes the library unusable in such environments.

To Reproduce
Configure a JVM with a restrictive SecurityManager or limited file system permissions.

Initialize Password4j (e.g., call a hashing function).

Observe that exceptions are thrown during initialization or config loading.

Expected behavior
Gracefully handle permission restrictions (e.g., skip config file loading), or

Fail safely with clear error messages, without crashing the application.
Environment:
OS: Any (e.g., Linux, Windows with restricted permissions)

JDK: OracleJDK / OpenJDK (e.g., 11, 12, 17)

Password4j Version: e.g., 1.2.0
Additional context
This issue is relevant for enterprise or sandboxed environments where applications run with strict security policies. Enhancing exception handling would improve Password4j’s stability, portability, and adoption in restricted environments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions