Skip to content

LaminasAuthenticationFactory does not detect empty redirect URL as missing #18

@InvisibleSmiley

Description

@InvisibleSmiley

Bug Report

Q A
Version(s) 1.3.0

Summary

The LaminasAuthenticationFactory only throws an exception if the "redirect" config key is missing, but the ConfigProvider initialized it with an empty string.

Current behavior

No exception if the "redirect" key is not associated with an actual URL (or at least a non-empty string).
Hence, a redirect loop happens in case LaminasAuthentication::unauthorizedResponse is triggered.

How to reproduce

  1. Add this lib to a Mezzio project without setting/overriding the "redirect" config key.
  2. Somehow trigger LaminasAuthentication::unauthorizedResponse

Expected behavior

If a Mezzio project does not set/override the "redirect" config key, I expect an exception instead of a redirect loop as a result of missing/incomplete config.

Technically, either the ConfigProvider should not specify the key, or the LaminasAuthenticationFactory should check that the config value is non-empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions