Skip to content

[DX][Security] Check for server PHP_AUTH_USER #13950

@rvanlaak

Description

@rvanlaak

For a server-side payment notification service we authorize the $request->server parameters PHP_AUTH_USER and PHP_AUTH_PW. For complex security annotations we can always implement the Annotations of the JMSSecurityExtraBundle, but this seems a bit too much for this simple use-case:

// Authentication check
if (
    $request->server->get('PHP_AUTH_USER') != $this->container->getParameter('security_user') ||
    $request->server->get('PHP_AUTH_PW') != $this->container->getParameter('security_pw')
) {
    throw $this->createNotFoundException();
}

What I'd like to propose is that the @Security annotation is able to compare the server parameters with the values from the container parameters:

/**
 * @Security("php_auth('%security_user%', '%security_pw%')")
 */
public function showAction(Post $post)

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy