Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@motorina0
Copy link
Collaborator

@motorina0 motorina0 commented Feb 12, 2024

closes #2212

Summary

See issue #2212 . Prepare to allow more SSO providers (eg: Authentik, Keycloak or Authelia.)

The /auth endpoint now does not explicitly uses google or github. Any number of SSO Providers can be used now.

In order to add a new provider one must:

  1. Implement the ProviderSSO class (eg: KeycloakSSO)
  • this class must be added in the lnbits.core.sso.provider. The full namespace is lnbits.core.sso.provider.ProviderSSO
  • several implementation examples can be found here: https://github.com/tomasvotava/fastapi-sso/tree/master/fastapi_sso/sso
  • ideally the new implementation is accepted by fastapi-sso. Please also open a PR to the above repo (fastapi-sso) with the new implementation.
  1. Create a settings class for the new Provider (eg: KeycloakAuthSettings). See GitHubAuthSettings as an example. Then add this class to EditableSettings.
  • don't forget to update the env.example file
  1. Add the new provider to AuthMethods enum
  2. Update the Login UI with the new auth provider

@codecov
Copy link

codecov bot commented Feb 12, 2024

Codecov Report

Attention: 38 lines in your changes are missing coverage. Please review.

Comparison is base (98338ff) 59.26% compared to head (f171004) 59.29%.
Report is 3 commits behind head on dev.

Files Patch % Lines
lnbits/core/views/auth_api.py 19.14% 38 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2263      +/-   ##
==========================================
+ Coverage   59.26%   59.29%   +0.03%     
==========================================
  Files          60       60              
  Lines        9026     9036      +10     
==========================================
+ Hits         5349     5358       +9     
- Misses       3677     3678       +1     

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

@motorina0 motorina0 marked this pull request as ready for review February 12, 2024 12:02
@prusnak prusnak added this to the 0.12.2 milestone Feb 12, 2024
@motorina0 motorina0 mentioned this pull request Feb 13, 2024
Copy link
Collaborator

@prusnak prusnak left a comment

Choose a reason for hiding this comment

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

utACK

@dni dni merged commit b8d295a into dev Feb 14, 2024
@dni dni deleted the generalize_sso branch February 14, 2024 06:57
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 request] Allow custom OIDC Providers for SSO

3 participants