Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

New login flow: Use OAuth2 JWT as external identifier #12830

Closed
wants to merge 6 commits into from

Commits on May 21, 2022

  1. Added a new login flow (standalone JWT)

    This new login flow is an improved version of org.matrix.login.jwt
    
    The later
      * required the OICD provider's public key to be written to the
        homeserver.yml
      * accepted only one possible issuer of JWT tokens
      * has its own section in homeserver.yml and completely ignores
        'oidc_providers'
      * Used the 'sub' from the JWT as localpart of the user's address
      * required the JWT to be sent in the body of the login request
      * Created a new user if it wasn't found - no configuration possible
    
    The new login flow (called org.matrix.login_oidc_jwt)
      * uses section 'oidc_providers' from homeserver.yml
      * accepts all configured providers as (possible) issuer of JWT tokens
      * uses the configured 'jwks_uri' to fetch the provider's public key
      * fetches the JWT either from the body and if there's none it checks
        the 'Authentication' http header
      * extracts iss/sub from JWT and searches the 'external_ids' of the
        user database. If such an entry is found the user is authorized;
        otherwise the user is rejected
    aytchell committed May 21, 2022
    Configuration menu
    Copy the full SHA
    024b7a4 View commit details
    Browse the repository at this point in the history
  2. Added two config parameters for the new login flow

    New config parameters in section 'oidc_providers':
    
      * sso_jwt_enabled (boolean) - allows an admin to disable the new
        login flow for a given oidc_provider while at the same time keep the
        standard sso login flow for the oidc_provider allowed
    
      * standalone_jwt_audience (string) - if the new JWT login flow is
        allowed for an oidc_provider then this parameter can be used to
        enforce a specific audience claim to be contained in the JWT
        (otherwise the login attempt will be rejected)
    aytchell committed May 21, 2022
    Configuration menu
    Copy the full SHA
    928a7bd View commit details
    Browse the repository at this point in the history
  3. Added documentation for the new login flow

    Signed-off-by: Hannes Lerchl <hannes.lerchl@googlemail.com>
    aytchell committed May 21, 2022
    Configuration menu
    Copy the full SHA
    a107999 View commit details
    Browse the repository at this point in the history
  4. Added changelog entry

    Signed-off-by: Hannes Lerchl <hannes.lerchl@googlemail.com>
    aytchell committed May 21, 2022
    Configuration menu
    Copy the full SHA
    92d04fd View commit details
    Browse the repository at this point in the history
  5. Fixed two failing unit tests

    aytchell committed May 21, 2022
    Configuration menu
    Copy the full SHA
    0963b65 View commit details
    Browse the repository at this point in the history

Commits on May 23, 2022

  1. Fixed failing PR tests

    * generated sample_config
    * used black to format code
    * fixed tyoe hint findings of mypy
    aytchell committed May 23, 2022
    Configuration menu
    Copy the full SHA
    1778292 View commit details
    Browse the repository at this point in the history