Calling Developers!
We are reenergizing our code contribution process! Learn More

What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello, does somebody know if there is any possibility to make a public accessible page in sprykers z

Options
UPWG9AYH2
UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

Hello,
does somebody know if there is any possibility to make a public accessible page in sprykers zed backend? As far as i know, the only page that is accessible without beeing authenticated is the login page itself. But since the symfony firewall points as “login_path” option to it, this route is automatic public to not authenticated users due to some magic symfony logic in the background…
We want to redirect a user to a zed-hosted information page where he gets infos how to get access to the backend (“Please contact admin bla bla … “) … but for my actual understanding, this page must be accessible to not authenticated users.
We tried to add the route to the ignorable pattern of the security plugins config but it seems not to have any effect … the guard always tries to authenticate the user when he want to access that specific route.

Last option would be to add another firewall for only this one page… but would really like to avoid that …
Any ideas?
Best

Comments

  • U01A5ARAXP0
    U01A5ARAXP0 Posts: 119 🧑🏻‍🚀 - Cadet
    Options

    look for the constant IGNORABLE_ROUTE_PATTERN

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet
    Options

    We tried to add the route to the ignorable pattern of the security plugins config but it seems not to have any effect

  • U01A5ARAXP0
    U01A5ARAXP0 Posts: 119 🧑🏻‍🚀 - Cadet
    Options

    on SecurityGuiConfig.php?

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet
    Options

    I have another assumption ..I think it might be that the user is not “un-authenticated” in the moment we want to reach the controller … for example: the user is logged in … the token guard has noticed that the user should not be logged in anymore … authentication error is thrown and redirect to the info page should happen … but on redirect, the user is still logged in … any idea how to “programatically” log the user out without routing them to the logout route?

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    Options

    SecuriyGuiConfig::IGNORABLE_ROUTE_PATTERN u have to add your route and in config u have to add the acl default rules and specify also what is allowed/denied (\Spryker\Shared\Acl\AclConstants::ACL_USER_RULE_WHITELIST and \Spryker\Shared\Acl\AclConstants::ACL_DEFAULT_RULES)

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet
    Options

    Yeah, i tried this, but seems no effect … my guess is, i am still logged in …
    with

    $accessRules = [
    [
    $this->getConfig()->getIgnorablePaths(),
    static::IS_AUTHENTICATED_ANONYMOUSLY,
    ],
    [
    $this->getConfig()->getBackOfficeRoutePattern(),
    SecurityOauthUserConfig::ROLE_BACK_OFFICE_USER,
    ],
    [
    $this->getConfig()->getBackOfficeRoutePattern(),
    SecurityOauthUserConfig::ROLE_OAUTH_USER,
    ],
    ];

    on the security plugin it seems that the ignroable paths only apply to anonymously authenticated users … which is not the case when i am still loged in … so, i have to find a way to force log out BEFORE this redirect

  • U01A5ARAXP0
    U01A5ARAXP0 Posts: 119 🧑🏻‍🚀 - Cadet
    Options

    have you tried adding the controller to $config[AclConstants::ACL_DEFAULT_RULES]