Skip to content

Fix startAuthenticationWorflow typo (keep deprecated alias) - #25

Open
animex wants to merge 1 commit into
coldbox-modules:developmentfrom
animex:fix/start-authentication-workflow-typo
Open

animex wants to merge 1 commit into
coldbox-modules:developmentfrom
animex:fix/start-authentication-workflow-typo

Conversation

@animex

@animex animex commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Fix startAuthenticationWorflow typo (keep deprecated alias)

Bug

The provider contract method is misspelled startAuthenticationWorflow (missing "k") in ISSOIntegrationProvider, every built-in provider, and the Auth.start() handler that calls it from /cbsso/auth/:provider/start. A custom provider, or a subclass of a built-in one, that implements or overrides the correctly spelled startAuthenticationWorkflow() is never called. The start route silently uses the inherited misspelled method instead. For example, a Google subclass that sets OAuth state in its override never sets it, so every login then fails the state check on callback.

Fix

  • Renamed the method to startAuthenticationWorkflow() in ISSOIntegrationProvider, the Google, GitHub, Facebook and MicrosoftSAML providers, and the test-harness CustomProvider.
  • Auth.start() now calls startAuthenticationWorkflow().
  • Added a changelog entry under Unreleased.

Backward compatibility

  • BaseProvider keeps startAuthenticationWorflow() as a @deprecated alias that delegates to startAuthenticationWorkflow(). Existing code that calls the old name on a built-in provider keeps working.
  • Auth.start() falls back to the old name when a provider has no startAuthenticationWorkflow(). Custom providers that don't declare implements="cbsso.models.ISSOIntegrationProvider" and only define the old name keep working.
  • One caveat: a custom provider that declares implements="cbsso.models.ISSOIntegrationProvider" and only defines the misspelled method must rename it, because the interface now requires the correct name. The fix is a one-line rename. We suggest removing the alias and the fallback in the next major release.

Tests

Added an AuthHandlerSpec case that checks the alias returns the same URL as the new method, and that built-in providers expose both names. The full suite passes on Lucee 5.4.8.2 / TestBox 7.1.0: 45 passed, 0 failed, 0 errors.

Fixes #24

Rename ISSOIntegrationProvider.startAuthenticationWorflow() to
startAuthenticationWorkflow() across the interface, built-in providers,
the Auth handler and the test-harness provider. BaseProvider keeps the
misspelled name as a deprecated alias, and Auth.start() falls back to it
for custom providers that only define the old name.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Legacy overrides on built-in provider subclasses can be bypassed, and the tests do not verify handler dispatch or fallback behavior.

2 open findings
What changed in this PR

Corrects the provider authentication workflow typo while retaining backward compatibility.

Changes:

  • Renames the provider contract and implementations.
  • Adds deprecated alias and handler fallback logic.
  • Adds regression coverage and changelog documentation.
File Description
handlers/​Auth.cfc Dispatches to the corrected method with legacy fallback.
models/​ISSOIntegrationProvider.cfc Corrects the interface method name.
models/​providers/​BaseProvider.cfc Adds the deprecated alias.
models/​providers/​GoogleProvider.cfc Renames the workflow method.
models/​providers/​GitHubProvider.cfc Renames the workflow method.
models/​providers/​FacebookProvider.cfc Renames the workflow method.
models/​providers/​MicrosoftSAMLProvider.cfc Renames the workflow method.
test-harness/​models/​CustomProvider.cfc Updates the test provider and adds an alias.
test-harness/​tests/​specs/​AuthHandlerSpec.cfc Adds compatibility assertions.
changelog.md Documents the correction and compatibility behavior.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread handlers/Auth.cfc
Comment on lines +27 to +30
if ( structKeyExists( prc.ssoProvider, "startAuthenticationWorkflow" ) ) {
relocate( url = prc.ssoProvider.startAuthenticationWorkflow( event ) );
} else {
relocate( url = prc.ssoProvider.startAuthenticationWorflow( event ) );
Comment on lines +62 to +65
it( "keeps the deprecated startAuthenticationWorflow alias working on providers", function(){
var provider = getInstance( "CustomProvider" );
expect( provider.startAuthenticationWorflow( getRequestContext() ) ).toBe(
provider.startAuthenticationWorkflow( getRequestContext() )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

startAuthenticationWorflow typo: overriding startAuthenticationWorkflow() is never called

2 participants