Skip to content

fix(security): keep the login form entry point when X.509 may fall through to other mechanisms - #17250

Open
borinquenkid wants to merge 9 commits into
7.0.xfrom
fix/x509-entry-point-on-7.0.x
Open

borinquenkid wants to merge 9 commits into
7.0.xfrom
fix/x509-entry-point-on-7.0.x

Conversation

@borinquenkid

Copy link
Copy Markdown
Member

Replaces #16974, which was based on 7.2.x. The bug is also on 7.0.x, the oldest branch with it, so the same changes are rebuilt there. The review history is on #16974.

Fixes #15863
Fixes #15864

useX509 replaced the authenticationEntryPoint bean with a Http403ForbiddenEntryPoint unconditionally. A request without a usable certificate that needed authentication therefore got a bare 403, even with x509.continueFilterChainOnUnsuccessfulAuthentication = true, which is the default and is documented as "proceed ... to allow other authentication mechanisms to process the request". Both issues report exactly that: form login cannot coexist with X.509, and the reporters worked around it with a URL mapping for the error status.

The 403 entry point is now defined only when x509.continueFilterChainOnUnsuccessfulAuthentication is false, that is when certificates are the only way in. Otherwise the plugin's normal entry point stays, so the request goes to the login form (or its Ajax equivalent). x509.adoc now says what each value does.

Behavior change

With the default (true), an application that uses X.509 only and relied on the bare 403 for a request without a certificate now redirects that request to /login/auth. Such an application keeps the old behavior by setting grails.plugin.springsecurity.x509.continueFilterChainOnUnsuccessfulAuthentication = false, which also matches what the property says. I judged that better than a new property, but it is the point for reviewers to weigh.

Tests

  • X509EntryPointSpec (new) builds the plugin's real bean definitions with useX509 on and checks the authenticationEntryPoint bean for both values of the property. The true case fails before the change (the bean was the 403 entry point).
  • On 7.0.x the plugin's 212 tests pass (2 skipped), as does codeStyle. With the change to the plugin class taken out, 17 of the 25 tests of X509EntryPointSpec fail.

Not covered: a request with a real client certificate through a running server; the functional-test-app has no TLS setup for it.

https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL

…fall through

useX509 replaced the authenticationEntryPoint bean with a Http403ForbiddenEntryPoint
unconditionally, so a request without a usable certificate got a bare 403 even with
x509.continueFilterChainOnUnsuccessfulAuthentication = true (the default), which is
documented as letting other authentication mechanisms process the request. The 403
entry point is now defined only when that property is false, that is when
certificates are the only way in.

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
…ion as one boolean

A value set in application.properties or on the command line is the string 'false', which Groovy truth reads as true,
so the entry point condition kept the login form while the filter, to which Spring converts the string, refused the
request. The plugin now parses the setting once and uses it for both.

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
…ion the way the filter property does

Answers the review of #16974: Boolean.parseBoolean read yes, on, 1 and a padded true as false, so a setting that used to continue the chain after a failed certificate refused the request. The setting is now converted by Spring's own converter, which the filter property always used, so the entry point and the filter agree for every spelling. The spec tries each spelling and a value that is no boolean.

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@jdaugherty jdaugherty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix does what #15863 and #15864 ask: with the default, a request without a usable certificate now reaches the login form, and certificate login and form login both work side by side. The spec is solid too (reverting the plugin change fails 17 of its 25 tests, and none of the mutations I tried on the new lines survives). What I am asking for is around it: the upgrade note, the way back to the old result, the new doc sentence, one conversion detail, and a spec that pins the request-level behavior.

1. Upgrade note

This fix changes a result: an application with useX509 and the default setting used to answer 403 and now answers 302 to /login/auth. Per "Fixes That Change a Result" in CONTRIBUTING.md it needs a section in upgrading60x.adoc and the same entry in grails-skills/upgrade/skills/grails-upgrade/SKILL.md (#17249 has the shape). The note should cover:

  • what was returned before and what is returned now, for a request without a certificate and for a certificate that maps to no user (both change);
  • how to keep the old result. That is not x509.continueFilterChainOnUnsuccessfulAuthentication = false: with false, a certificate that fails authentication makes the X.509 filter rethrow, and since that filter runs before the exception translation filter the request ends in a 500, on every URL including public ones. With the old default the same request got 403 on a secured URL and public pages were served. The equivalent is to define the bean in resources.groovy: authenticationEntryPoint(Http403ForbiddenEntryPoint);
  • that authenticationEntryPointBeanClass now applies to the default definition when X.509 continues the chain, so a class without the login-form constructor (for example Http403ForbiddenEntryPoint itself) no longer starts: "Could not resolve matching constructor". Before, the X.509 block built that class with no arguments;
  • that an application using InterceptUrlMap or Requestmap needs a rule that permits /login/**, or the redirect is itself rejected (I read this from rejectIfNoRule, I did not run it).

2. A spec for the request-level behavior

X509EntryPointSpec checks which bean class is registered. What an application sees is the response, and that is what we will want to look up later, so please add a data-driven spec with one where: row per row of this table, and put the table in the spec's Javadoc. I measured it on this head and on the merge base by building the plugin's real springSecurityFilterChain in a GrailsWebUnitTest and sending it MockHttpServletRequests with the jakarta.servlet.request.X509Certificate attribute set (a keytool-generated certificate is enough, no TLS needed); the same requests against an embedded Tomcat with a TLS connector gave the same answers.

alice has a user, mallory has none, bob logs in with the form. /secure/page needs authentication, /login/auth is permitted to all.

continue… Request Before With this PR
true (default) no certificate, /secure/page 403 302 to /login/auth
true no certificate, Ajax, /secure/page 403 302 to /login/authAjax
true alice's certificate, /secure/page 200 as alice 200 as alice
true alice's certificate, a URL that needs a role she lacks 403, forward to /login/denied same
true mallory's certificate, /secure/page 403 302 to /login/auth
true mallory's certificate, /login/auth 200 anonymous 200 anonymous
true bob, no certificate: /secure/page, then POST /login/authenticate, then /secure/page 403 (the login POST itself works) 302 to the form, 302 back, 200 as bob
true bob presenting mallory's certificate, same three steps as above 302, 302, 200 as bob
false no certificate, /secure/page (plain and Ajax) 403 403
false alice's certificate, /secure/page 200 as alice 200 as alice
false mallory's certificate, any URL, /login/auth included UsernameNotFoundException out of the chain (500 on Tomcat) same
false bob, no certificate: /login/auth, POST /login/authenticate, /secure/page 200, 302, 200 as bob same

The false half is unchanged by this PR, which is the point of having it in the spec: it shows that only the default path moves. The 500 for a rejected certificate with false was there before, so I am not asking for it to be fixed here, only for the row to record it.

3. Inline

The rest is inline: the conversion target, the doc sentence, and two small things in the spec.

// Spring to convert (true, on, yes and 1, with any letter case and surrounding space, are true; false, off, no and 0 are
// false), so the entry point is decided by the same conversion, not by Groovy truth or Boolean.parseBoolean
Object configuredContinue = conf.x509.continueFilterChainOnUnsuccessfulAuthentication
boolean continueFilterChain = configuredContinue == null ? true : (Boolean) new SimpleTypeConverter().convertIfNecessary(configuredContinue, Boolean)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment above says this is the same conversion the filter property got, but the filter's setter takes a primitive boolean, and Spring's editor for Boolean allows an empty value where the one for boolean does not. So '' or a blank string comes back as null here. That is a value an application can produce: continueFilterChainOnUnsuccessfulAuthentication: with nothing after it in YAML, ...= in a properties file, or a placeholder whose environment variable is set but empty.

Today the application still fails to start, because the null reaches the filter property, but the message is "A null value cannot be assigned to a primitive type" where it used to be "Invalid boolean value []". And it only fails because the variable is captured by the bean closure: the same expression in a plain method gives false without an error, so this is one refactoring away from a blank value silently selecting the 403 entry point.

Converting to the primitive keeps every spelling the spec lists and fails on a blank value with the old message:

Suggested change
boolean continueFilterChain = configuredContinue == null ? true : (Boolean) new SimpleTypeConverter().convertIfNecessary(configuredContinue, Boolean)
boolean continueFilterChain = configuredContinue == null ? true : (boolean) new SimpleTypeConverter().convertIfNecessary(configuredContinue, boolean)

I tried this locally: '', ' ' and 'maybe' fail with "Invalid boolean value", 'false' and ' On ' convert as before. Please add '' and a blank string to the "fails at startup" feature.

Comment on lines +1111 to +1112
// certificates are the only way in, so a request without a usable one is simply forbidden; otherwise the
// default entry point stays, which sends the request to the login form (or the Ajax equivalent)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"certificates are the only way in" is not what false does: the form login, remember-me and basic filters stay in the chain, and a request without a certificate passes the X.509 filter whatever the flag says (Spring only consults it when a certificate was presented and rejected). With false and no certificate, a user can still open /login/auth and log in with a password. What the flag decides here is only which entry point answers an unauthenticated request. Could the comment say that instead?

|x509.continueFilterChainOnUnsuccessfulAuthentication
|`true`
|Whether to proceed when an authentication attempt fails to allow other authentication mechanisms to process the request
|Whether to proceed when an authentication attempt fails to allow other authentication mechanisms to process the request. When `true`, a request without a usable certificate that needs authentication is sent to the login form like any other; when `false`, certificates are the only way in and such a request gets a 403 response

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The true half is accurate. The false half is not, on both counts:

  • "certificates are the only way in": form login still works with false, so someone reading this could believe password login is switched off when it is not.
  • "such a request gets a 403 response": only when no certificate is sent. A certificate that fails authentication (no such user, and I would expect the same for a disabled or locked account) is rethrown by the filter and the request ends in a server error, on every URL.

Something like: "when false, a request without a certificate that needs authentication gets a 403 response instead of the login form, and a certificate that fails authentication makes the request fail with an error. Form login remains available in both cases."

'0' || Http403ForbiddenEntryPoint
}

void 'the setting not set at all keeps the default, which continues the chain'() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature sets the key to an explicit null, which survives the config merge, so it tests "set to null" rather than "not set at all". (That is a small change of its own: an explicit null used to fail at startup and now means true. Fine, but worth the accurate name.)

The case from the two issues, the key never set and the default from DefaultSecurityConfig applying, has no feature. Could you add one that leaves the key out of the config? It fails on the base and passes here.


package grails.plugin.springsecurity

import org.springframework.beans.BeansException

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this import belongs with the org.springframework group below, next to Http403ForbiddenEntryPoint. The style checks do not run on test sources, so nothing flags it.

…nt the result change and its way back

The entry point was decided from the setting converted to a Boolean, so a blank value became null and failed with a
different message than before; it is converted to the primitive, as the filter property is, and a blank value fails with
Invalid boolean value. The comment and the table of the guide said that certificates are the only way in with false,
which is not what the setting does: form login stays, and a certificate that fails authentication ends in an error. The
change of result with the default (302 to the login form instead of 403) has its upgrade note and skill entry, with the way
to keep the 403, and the spec has a feature for the setting never set, and for blank values.

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
@borinquenkid

Copy link
Copy Markdown
Member Author

Done in 4b13b29, point by point:

  • Upgrade note. upgrading60x.adoc (Grails 7.0.18) and grails-skills/upgrade/skills/grails-upgrade/SKILL.md have the entry: the before and after for a request without a certificate and for a certificate that maps to no user, the way back as authenticationEntryPoint(Http403ForbiddenEntryPoint) in resources.groovy and not continueFilterChainOnUnsuccessfulAuthentication = false (with the error on every URL), the authenticationEntryPointBeanClass consequence, and the rule that permits /login/** for interceptUrlMap and Requestmap. Two statements come from your measurements and I did not run them: the "Could not resolve matching constructor" start failure, and the /login/** rejection.
  • Conversion. The setting is converted to the primitive, as the filter property is, so '', ' ' and 'maybe' fail with "Invalid boolean value" and the spellings the spec lists convert as before. The spec has the blank and whitespace rows in the "fails at startup" feature; with the earlier conversion put back, those two rows fail.
  • Never set. A feature leaves the key out of the configuration and merges DefaultSecurityConfig in as startup does, and the entry point is the form one. The feature that set the key to an explicit null is renamed "the setting set to null means true".
  • Comment and guide. The comment in the plugin and the x509.adoc row now say what false does: only the entry point changes, form login stays, a request without a certificate passes the X.509 filter whatever the flag says, and a certificate that fails authentication ends in an error. I used your wording for the guide.
  • Import. Moved next to Http403ForbiddenEntryPoint.

Not done in this commit: the data-driven request-level spec for your table. It needs the real springSecurityFilterChain with generated certificates in a GrailsWebUnitTest, and I will add it as a follow-up commit on this branch. grails-spring-security passes (215 tests) and codeStyle passes.

@jamesfredley jamesfredley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested changes. An existing entry-point class can prevent startup, and an empty login URL can too.

}

authenticationEntryPoint(classFor('authenticationEntryPoint', Http403ForbiddenEntryPoint))
if (!continueFilterChain) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With useX509=true, the default continuation setting, and authenticationEntryPointBeanClass=Http403ForbiddenEntryPoint, the plugin passes a login URL to a no-argument constructor. Spring reports that it could not resolve a matching constructor. The same configuration previously started and returned 403. Do not pass the login URL to a bean that does not take one. An empty auth.loginFormUrl fails the same way for the retained login entry point.

…-on-7.0.x

# Conflicts:
#	grails-doc/src/en/guide/upgrading/upgrading60x.adoc
#	grails-skills/upgrade/skills/grails-upgrade/SKILL.md
…en it takes one

With useX509 and the default continue setting, the plugin keeps the login entry point and gives it auth.loginFormUrl. An application that sets authenticationEntryPointBeanClass to a class without a login-URL constructor, such as Http403ForbiddenEntryPoint, or leaves auth.loginFormUrl blank, started with X.509 before and failed at startup after that change. The entry point is now built as it was, with no arguments and answering 403, when the configured class takes no login URL or there is no URL to give it.

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
@borinquenkid

Copy link
Copy Markdown
Member Author

Two commits: a merge of 7.0.x, and a539e085c73 for the finding (SpringSecurityCoreGrailsPlugin.groovy:1111).

The merge. It clears conflicts in upgrading60x.adoc and the upgrade skill. Both sides are kept, and it changes nothing else.

The finding. With useX509, the default continue setting and authenticationEntryPointBeanClass set to Http403ForbiddenEntryPoint, the plugin passed the login URL to a class that takes none, and an empty auth.loginFormUrl failed the same way. Both started before. The entry point is now built the earlier way, with no arguments and answering 403, when the class that is configured takes no login URL, or when there is no URL to give it. A class with a login-URL constructor still gets auth.loginFormUrl and keeps the redirect to the login form. The upgrade note and the skill entry said that such a class no longer starts. They now say what happens.

I generated the class instead of fixing the two cases: the continue setting (true, 'true', false, 'false'), the class that is configured (none, Http403ForbiddenEntryPoint, a class with a no-argument constructor, a subclass of the plugin's entry point), and auth.loginFormUrl (a URL, empty, blank, unset). That is 64 rows in X509EntryPointSpec. Each asserts that an application that started with X.509 before still starts, and which entry point it gets. With SpringSecurityCoreGrailsPlugin.groovy put back, 22 of the 64 rows fail.

The Spring Security plugin module passes (322 tests) and codeStyle passes. The 12-row request-level spec with a real filter chain and generated certificates is still owed and is not in this push.

…e filter chain the plugin builds

The spec builds the real springSecurityFilterChain in a GrailsWebUnitTest and sends it requests with the jakarta.servlet.request.X509Certificate
attribute set, with certificates made by keytool for alice (a user), mallory (no user), and bob, who logs in with the form: fourteen rows, with
the table in the Javadoc, for the default and for x509.continueFilterChainOnUnsuccessfulAuthentication = false. The five rows of the default
that change with this fix (no certificate, by Ajax, a certificate with no user, and the form login steps of bob) fail on 7.0.x; the nine others
pass on both, the false rows among them, which shows that only the default path moves.
@borinquenkid

Copy link
Copy Markdown
Member Author

Pushed the spec you asked for in section 2 of the review of 12-03: what an application answers, through the filter chain the plugin builds. The rest of that review is in the commit of 12-03 (4b13b29b80): the upgrade note and its way back, the conversion to one primitive boolean that fails on a blank value, the sentence of the guide, and the features that name "never set" and "set to null" apart. This was the part I had said was not included yet.

X509RequestSpec builds the real springSecurityFilterChain in a GrailsWebUnitTest (the plugin's beans, then doWithApplicationContext, which puts the filters in the chain as at startup) and sends it MockHttpServletRequests with the jakarta.servlet.request.X509Certificate attribute set, with certificates from keytool for alice (a user), mallory (no user) and bob (logs in with the form). /secure/page needs authentication, /admin/page needs ROLE_ADMIN, /login/** is permitted to all. It has one where: row for each row of your table, 14 in all (the two with Ajax and the two paths of mallory are separate rows), and the table is in the Javadoc.

With this change all 14 pass. With the plugin as it is on 7.0.x the five rows whose answer changes fail (a request with no certificate, the same by Ajax, mallory's certificate on a secured page, and the two form-login sessions of bob with the default), and the other nine pass, the six with false among them: so the spec shows that only the default path moves, as you said.

Two things in the rows that the table did not spell out, in case they matter to you. A login starts a new session (session fixation protection), so each step of a row follows the session the previous response made, as a browser follows its cookie. And the form login lands on /secure/page?continue when a request was saved, and on / when none was, which is what the rows assert.

grails-spring-security passes (336 tests) and codeStyle is clean.

@jamesfredley jamesfredley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested changes. The no-argument-only entry point and a blank login URL no longer prevent startup. An entry point that has both constructors can, and a login URL that is not a redirect URL can too.

*/
private static boolean takesLoginFormUrl(Class entryPointType, Object loginFormUrl) {
loginFormUrl instanceof CharSequence && loginFormUrl.toString().trim() &&
entryPointType.constructors.any { it.parameterTypes == [String] as Class[] }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An existing entry point with both a no-argument constructor and a String constructor, but without the form-login setters, now fails bean initialization. Previously the no-argument constructor was used. Do not pass the login URL to a bean that does not take the form-login properties.

* Whether the entry point can be built for the login form: it has a constructor of a login URL, and there is one to give it.
*/
private static boolean takesLoginFormUrl(Class entryPointType, Object loginFormUrl) {
loginFormUrl instanceof CharSequence && loginFormUrl.toString().trim() &&

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auth.loginFormUrl = 'login/auth' is not blank, so this check keeps the form-login entry point. Spring Security then rejects the URL and startup fails. Previously an X.509 application started because that URL was unused. Accept only a URL the entry point can redirect to.

…finition can be built

The definition of the login form entry point gives the class a login URL, the Ajax login URL and six properties of the form login. With X.509 an
application that configured a class with both a no-argument and a login URL constructor but without those properties, a login URL that Spring
Security rejects as a redirect (login/auth), or an Ajax login URL without a leading slash, started on 7.0.x because the X.509 configuration built the
bean with no arguments, and failed to start with the first version of this fix. The login form entry point is now kept only when the class has the
constructor and the properties, the login URL starts with a slash or is an absolute http(s) URL, and the Ajax login URL is unset or starts with a slash;
in every other case the bean is built as it always was. The table of X509EntryPointSpec has 672 rows over the continue setting, six classes, seven
login URLs and four Ajax URLs, 80 of which fail with the previous check.
@borinquenkid

Copy link
Copy Markdown
Member Author

Pushed the next commit, which answers the review of 12-05 at a9f9a33. Both findings were regressions of the first version of this fix, against 7.0.x: there the X.509 configuration built the entry point with no arguments, so every application below started.

  • A class with a no-argument and a String constructor but without the form-login properties. It got the login URL and failed with the first version.
  • A login URL that Spring Security rejects as a redirect (login/auth). It started on 7.0.x because the URL was unused with X.509, and failed here.

Both come from one rule that the commit now states in one place: the login form entry point is kept only when its whole definition can be built, which is what it sets and gives it. The class needs the String constructor and the six properties the definition sets (ajaxLoginFormUrl, forceHttps, useForward, portMapper, portResolver, redirectStrategy), auth.loginFormUrl starts with a slash or is an absolute http or https URL (the check is Spring Security's own, UrlUtils.isValidRedirectUrl), and auth.ajaxLoginFormUrl is unset or starts with a slash, which AjaxAwareAuthenticationEntryPoint asserts too and a blank one fails. In every other case the bean is built as it always was, so an application that started before still starts.

X509EntryPointSpec is now a table over the continue setting (4 spellings), the entry point class (6, among them one with both constructors and no properties, and an Ajax subclass with both constructors), the login URL (7: valid, absolute https, relative, a leading space, blank, blank spaces, null) and the Ajax login URL (4), 672 rows. The expectation is computed in the spec from the rule above, not by the plugin code. With the previous check 80 rows fail. The upgrade note and the entry of the upgrade skill state the rule instead of the constructor alone.

grails-spring-security passes (944 tests) and codeStyle is clean.

@testlens-app

This comment has been minimized.

@jamesfredley jamesfredley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested changes. A blank login URL no longer keeps the form entry point. An entry point whose String constructor throws still does.

private static boolean takesLoginForm(Class entryPointType, Object loginFormUrl, Object ajaxLoginFormUrl) {
loginFormUrl instanceof CharSequence && UrlUtils.isValidRedirectUrl(loginFormUrl.toString()) &&
(ajaxLoginFormUrl == null || ajaxLoginFormUrl instanceof CharSequence && ajaxLoginFormUrl.toString().startsWith('/')) &&
entryPointType.constructors.any { it.parameterTypes == [String] as Class[] } &&

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An entry point with both constructors and the form-login setters passes this check even when its String constructor throws. Previously the no-argument constructor was used and the application started. Now startup fails. Use the constructor that works.

…r X.509 keeps it

The check predicted whether the definition of the login form entry point can be built, from the constructors, the
setters and the form of the URLs. It could not know that a constructor, a setter or the initialization throws, nor that
a protected constructor builds, so an entry point whose String constructor throws was kept and the application failed to
start. The plugin now builds it once with the values the default definition gives it, then initializes it, and keeps the
login form entry point only when that succeeds; the log names the class and the cause when it does not.

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
@borinquenkid

Copy link
Copy Markdown
Member Author

@jamesfredley an entry point whose String constructor throws was kept, and the application failed to start. That is the one you found, and it is the class of the earlier two (a no-argument-only class, a blank login URL): the check predicted whether the login form definition could be built, from constructors, setters and the form of the URLs, and a prediction cannot know that a constructor, a setter or the initialization throws.

takesLoginForm is gone. The plugin now builds the login form entry point once, as the default definition does (the constructor with auth.loginFormUrl, then ajaxLoginFormUrl, forceHttps, useForward, portMapper, portResolver and redirectStrategy, then its initialization) and keeps it only when that succeeds. Otherwise the entry point is built with no arguments as X.509 always built it, and a warning names the class and the cause. This also stops refusing a class with a protected constructor, which the old check read as unbuildable although Spring builds it.

Table: 820 rows, 72 of them fail on the previous head. It varies the continue setting, the entry point class, the point where building the login form fails (the constructor, each of the six setters, the initialization, nowhere), the login URL and the Ajax URL. The module grails-spring-security passes (1064 tests) and so does codeStyle. The upgrade note and the skill entry describe the behavior as above.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants