Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
Closed
@rvanlaak

Description

@rvanlaak
Issue body actions

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.