Matt Raible created ROL-2186:
--------------------------------
Summary: Setup token can't be recovered if the setup session is
lost before the first user registers
Key: ROL-2186
URL: https://issues.apache.org/jira/browse/ROL-2186
Project: Apache Roller
Issue Type: Bug
Reporter: Matt Raible
On a new install, Roller prints a one-time setup token and sends every visitor
to {{/roller-ui/bootstrap-token.rol}}. When the token is accepted,
{{BootstrapSecurity.redeem()}} clears it and keeps the grant only in that
browser's HTTP session. A new token is generated only when Roller starts
({{BootstrapSecurity.start()}} is called from {{RollerContext}} at startup).
If that session is lost after the token is accepted but before the first
administrator registers, every new session is sent back to the token page. The
printed token is then refused with "The setup token is invalid or has
expired.", and no new token is issued. The only way to continue setup is to
restart Roller, and the page doesn't say so.
The session can be lost in several ordinary ways: closing the browser, the
session expiring, switching browsers, clearing cookies, or an automated setup
that stops partway through.
*Steps to reproduce*
# Start a fresh 6.1.7 RC4 with {{mvn jetty:run}} (in-memory Derby).
# Open {{/roller/}}, enter the token from the log, and create the database
tables.
# Before bootstrapping and registering, close the browser or open a private
window.
# Open {{/roller/}} again. It redirects to the token page. Enter the same token.
*Expected:* setup can continue, or the page explains how to get a new token.
*Actual:* "The setup token is invalid or has expired." No new token appears in
the log until Roller restarts.
Found while testing 6.1.7 RC4. The behaviour has been there since the setup
token was added in 6.1.6, so it doesn't block 6.1.7.
*Possible fixes*
* When setup isn't complete and the token page is visited after the token was
used, issue and log a fresh token. For example, call {{start()}} from the token
page when the stored token is null and setup isn't complete.
* Or keep the token valid until setup completes, instead of clearing it on
first use.
* At minimum, have the error message say that restarting Roller prints a new
token.
*Code*
*
{{app/src/main/java/org/apache/roller/weblogger/ui/core/security/BootstrapSecurity.java}}:
{{start()}}, {{redeem()}}, {{isValid()}}
* {{app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java}}:
the only callers of {{start()}}
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)