---
title: "Security.ifAuthenticated ViewHelper <f:security.ifAuthenticated>"
manual: "Fluid ViewHelper Reference"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-security-ifauthenticated@main"
source: "Global/Security/IfAuthenticated.rst"
modified: "2026-09-17T05:12:06+00:00"
---

# Security.ifAuthenticated ViewHelper `<f:security.ifAuthenticated>`

ViewHelper implementing an ifAuthenticated/else condition for frontend users.

Go to the source code of this ViewHelper: [Security\\IfAuthenticatedViewHelper.php (GitHub)](https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Security/IfAuthenticatedViewHelper.php).

**Table of contents**

-   [Examples](https://docs.typo3.org/permalink/t3viewhelper:examples@main)
-   [Arguments of the <f:security.ifAuthenticated> ViewHelper](https://docs.typo3.org/permalink/t3viewhelper:arguments-of-the-f-security-ifauthenticated-viewhelper@main)

## Examples

### Basic usage

**packages/my_extension/Resources/Private/Templates/Account/Show.fluid.html**

```html
<f:security.ifAuthenticated>
  This is being shown whenever a FE user is logged in
</f:security.ifAuthenticated>
```

Everything inside the `<f:security.ifAuthenticated>` tag is being displayed if
current frontend user is authenticated.

### IfAuthenticated / then / else

**packages/my_extension/Resources/Private/Templates/Account/Show.fluid.html**

```html
<f:security.ifAuthenticated>
  <f:then>
    This is being shown in case you have access.
  </f:then>
  <f:else>
    This is being displayed in case you do not have access.
  </f:else>
</f:security.ifAuthenticated>
```

Everything inside the `<f:then></f:then>` tag is displayed if frontend user is authenticated.
Otherwise, everything inside the `<f:else></f:else>` tag is displayed.

## Arguments of the `<f:security.ifAuthenticated>` ViewHelper

-   **else**

    -   *Type:* mixed

    Value to be returned if the condition if not met.

-   **then**

    -   *Type:* mixed

    Value to be returned if the condition if met.
