Skip to content

Conversation

@shiv-tyagi
Copy link
Contributor

Closes #726

This adds the disable_local_password option to the broker.conf. When set to true, the local password authentication mode is disabled completely and the user is forced to authenticate with device authentication.

In device authentication mode, the set local password step after successful authentication is skipped as well because it is not needed anymore.

I have tested this locally and it works as described.

@shiv-tyagi shiv-tyagi force-pushed the disable-local-password branch from 5495017 to ba71c03 Compare February 1, 2026 17:38
@codecov
Copy link

codecov bot commented Feb 1, 2026

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.54%. Comparing base (8304517) to head (ba71c03).

Files with missing lines Patch % Lines
authd-oidc-brokers/internal/broker/broker.go 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1234      +/-   ##
==========================================
- Coverage   87.64%   80.54%   -7.10%     
==========================================
  Files          91       20      -71     
  Lines        6231      987    -5244     
  Branches      111        0     -111     
==========================================
- Hits         5461      795    -4666     
+ Misses        714      192     -522     
+ Partials       56        0      -56     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adombeck adombeck self-requested a review February 2, 2026 12:51
Copy link
Contributor

@adombeck adombeck left a comment

Choose a reason for hiding this comment

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

Thank you for working on this, @shiv-tyagi! There's still a bit of work for us to do here, most notably we will have to figure out how to unlock the keyring when there's no local password.

session.nextAuthModes = []string{authmodes.NewPassword}

return AuthNext, nil
// Only require password creation if local password authentication is not disabled
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Only require password creation if local password authentication is not disabled
// Require password creation unless local password authentication is disabled

##
## When enabled:
## - Users will not be able to create or use local passwords
## - Device authentication will be required for every login
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## - Device authentication will be required for every login
## - Device authentication will be required for every authentication attempt,
## including logins and privileged operations (e.g. sudo, polkit actions)

## - Device authentication will be required for every login
## - Local password authentication mode will not be offered
##
## Important: Enabling this option prevents offline login entirely.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Important: Enabling this option prevents offline login entirely.
## Important: Enabling this option prevents offline authentication entirely.

Comment on lines +726 to +729
if !b.cfg.disableLocalPassword {
session.nextAuthModes = []string{authmodes.NewPassword}
return AuthNext, nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Another consequence of not creating a local password is that the keyring can't be unlocked. #1190 also won't fix it in that case.

## When enabled:
## - Users will not be able to create or use local passwords
## - Device authentication will be required for every login
## - Local password authentication mode will not be offered
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to self: We should probably point users to force_provider_authentication here, and maybe briefly discuss the use cases of force_provider_authentication and disable_local_password.

Comment on lines +726 to +729
if !b.cfg.disableLocalPassword {
session.nextAuthModes = []string{authmodes.NewPassword}
return AuthNext, nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to self: Manually test:

  • ssh
  • sudo
  • pkexec
  • unlocking keyring

Ideally we should add e2e tests for those.

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.

Feature: Disabling Local Passwords

2 participants