Form Authentication

The default authentication method of blocks is internalDigest, which doesn't support logout. Sometimes projects may call for a slightly more sophisticated method of authentication. This article describes how to set up blocks with the form authentication method.

First of all, stop the server and then follow this guide to set up blocks with a https certificate. Then apply the following settings for the server top level item in Blocks configuration file.

:!: IMPORTANT: Pay attention to the indentation under the server item, as shown below.

server:
  type: pixilab_server
  requireHttps: false
  # The line above is appropriate when using nginx in front of Blocks, managing the SSL connection.
  # If you manage SSL and certificate directly from within Blocks, set requireHttps to true instead, and
  # configure certificate as appropriate for Blocks.
  auth:
    servlet:
      security:
        - matchers: internalMatcher
          authorizers: isAuthenticated
          clients: internalForm
          #the above uses form authentication, which supports log-out. The default otherwise is internalDigest, which doesn't

Start the server again and you should now see a slightly differnet login prompt like in this image.

And here you will find the logout option: