Skip to content

OAuth auto-provision fails for plugin auth providers: generated password exceeds bcrypt 72-byte limit #31

Closed

Description

@thezak48

Summary

When auto_provision is enabled for a plugin OAuth auth provider (e.g. Discord), first-time OAuth sign-in fails because Silo generates a plugin-only password longer than bcrypt allows.

Steps to reproduce

  1. Install and enable an OAuth auth plugin (Discord works).
  2. Enable auth binding with auto_provision: true. (not visible in the UI yet so a PUT request to the API handles that)
  3. Sign in via OAuth with a user that does not yet exist in Silo.

Expected behavior

Silo auto-creates the user account and completes login.

Actual behavior

Login fails during auto-provisioning. Server log shows:

silo ... level=WARN msg="oauth login completion failed" installation_id=3 error="auto-provision plugin user: hashing password: bcrypt: password length exceeds 72 bytes"

Root cause

In internal/auth/plugin_provider.go, randomPluginOnlyPassword() currently generates:

  • "plugin-only-" + hex.EncodeToString(32 random bytes)

That yields a 76-character password (12 + 64), which exceeds bcrypt’s 72-byte max input length.

Suggested fix

Ensure generated plugin-only passwords are <=72 bytes before hashing, for example by reducing random bytes from 32 to 24 (12 + 48 = 60 chars), or by enforcing a hard cap.

Impact

This blocks onboarding for new OAuth users whenever plugin auth auto-provision is enabled.

Activity

  1. Quick104 commented on May 31, 2026

    @Quick104
    Contributor

    This has been addressed in #33, which has now been merged.

    The fix keeps generated plugin-only auto-provision passwords below bcrypt's 72-byte input limit, so first-time OAuth sign-in with auto_provision enabled can create the Silo user account successfully.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions