Skip to content

Member SSO Provider (OAuth2/OIDC)#617

Draft
krestenlaust wants to merge 60 commits into
nextfrom
feat_oidc-provider2
Draft

Member SSO Provider (OAuth2/OIDC)#617
krestenlaust wants to merge 60 commits into
nextfrom
feat_oidc-provider2

Conversation

@krestenlaust
Copy link
Copy Markdown
Member

@krestenlaust krestenlaust commented Mar 1, 2026

This PR adds

  • Login form to authenticate members using their email (One-Time Password member login)
  • Endpoints and logic needed for external OpenID login (External SSO provider)

How does it authenticate a member?
Whenever a Member logs in using the new login form (/ffo/login), a companion non-staff user is added, and a reference to the user is added to the member.

This user is then authenticated with requests, the same way django normally handles user logins.

How does it look on an external service?
Example buttons:
image

To-do:

  • Add proper SSO button template for easy copying
  • Handle duplicate User usernames, when creating companion user
  • Create OTP sign-in (right now it just accepts without proof of email)
  • Rename to 'ffo'
  • Find a way to replace dependency of custom fork: https://github.com/krestenlaust/django-oauth-toolkit/tree/2.4.0-custom-login-url
  • Add OpenAPI definiton
  • Update fixtures
  • Clean-up / tidy-up code
  • Add '.well-known' redirect at '/' to '/o'
  • Collapse migrations
  • Send actual email with OTP
  • Add roles-claim to signal whether a user is 'staff' or not
  • Add groups-claim and embed all user groups
  • Document creation of oidc.key, make sure you can start a dev env without it
  • Clean-up / tidy-up code again (in the end)
  • Add revoke-ability on user profile in stregsystem
  • Add tests to verify that admin logins still work independently

Related:

@krestenlaust krestenlaust linked an issue Mar 1, 2026 that may be closed by this pull request
@krestenlaust krestenlaust changed the title OpenID Connect OAuth - Passwordless Single-sign on using OTP OIDC - Passwordless Member Single-sign on using OTP Mar 1, 2026
krestenlaust added a commit to f-klubben/fappen that referenced this pull request Mar 1, 2026
@krestenlaust krestenlaust force-pushed the feat_oidc-provider2 branch from d77484c to f71a422 Compare March 2, 2026 21:58
- Backend ONLY validates now
- View contains OTP gen-logic
- Remove old tests, add new tests that test form
- Reduce login.html template
@krestenlaust
Copy link
Copy Markdown
Member Author

Current 'ffo/login', stage 1
image

stage 2
image

@krestenlaust krestenlaust added this to the Start of Fall 2026 milestone Mar 10, 2026
The user wasn't authenticated properly, because the wrong backend was
specified, so it just kept returning to the login page
It looks weird to a technical user that the get parameter disappears
after first login
@krestenlaust krestenlaust changed the title OIDC - Passwordless Member Single-sign on using OTP Member SSO Provider (OAuth2/OIDC) Mar 14, 2026
@krestenlaust krestenlaust linked an issue Mar 15, 2026 that may be closed by this pull request
@krestenlaust
Copy link
Copy Markdown
Member Author

Remember to add these checks to login

    if not member.signup_due_paid:
        return False

    if not member.signup_approved():
        return False

krestenlaust added a commit that referenced this pull request Apr 3, 2026
All changes made in #617 that are strictly related to login (no OIDC)
@krestenlaust
Copy link
Copy Markdown
Member Author

Extracted all login details into separate PR to make it more clean. This one will have to wait for that to be merged into main: #637

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.

OIDC single-sign on flow

1 participant