Skip to content

Configuration for failure_handler not working after updating from 1.4 to 2.2.0 #2010

@vladimirgolub

Description

@vladimirgolub

Actual Behavior

After updating HWIOAuthBundle from version 1.4 to 2.2.0, the following configurations stopped working:
The failure_handler settings are no longer functioning as expected. Instead of the intended JSON responses, an HTML page is being returned on authentication failure.

Expected Behavior

The failure_handler settings should work as they did in version 1.4, properly handling successful and failed authentication attempts and returning the configured JSON responses.

Steps to Reproduce
Update HWIOAuthBundle from version 1.4 to 2.2.0.
Configure the security firewall as follows:

api:
    pattern:   ^/api
    stateless: true
    entry_point: oauth
    jwt: ~
    oauth:
        resource_owners:
            facebook: api_facebook_login_check
            google:   api_google_login_check
            apple:    api_apple_login_check
        success_handler: lexik_jwt_authentication.handler.authentication_success
        failure_handler: lexik_jwt_authentication.handler.authentication_failure
        login_path:      index
        failure_path:    index
        check_path:      /api/login-check
        use_forward:     false
        oauth_user_provider:
            service: app.oauth_aware.user_provider.service

Attempt a failed authentication and observe the returned HTML response instead of the configured JSON response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions