Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨(backend) support Authorization Code flow #5

Merged
merged 7 commits into from
Mar 3, 2024
Merged

✨(backend) support Authorization Code flow #5

merged 7 commits into from
Mar 3, 2024

Commits on Feb 26, 2024

  1. ➕(project) configure Keycloak server to support OIDC

    Create a realm 'impress' and configure it to support
    the authorization code flow.
    lebaudantoine committed Feb 26, 2024
    Configuration menu
    Copy the full SHA
    1391400 View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2024

  1. 🔧(backend) configure Authorization Code authentication

    Integrate 'mozilla-django-oidc' dependency, to support
    Authorization Code flow, which is required by Agent Connect.
    
    Thus, we provide a secure back channel OIDC flow, and return
    to the client only a session cookie.
    
    Done:
    - Replace JWT authentication by Session based authentication in DRF
    - Update Django settings to make OIDC configurations easily editable
    - Add 'mozilla-django-oidc' routes to our router
    - Implement a custom Django Authentication class to adapt
    'mozilla-django-oidc' to our needs
    
    'mozilla-django-oidc' routes added are:
    - /authenticate
    - /callback (the redirect_uri called back by the Idp)
    - /logout
    lebaudantoine committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    99188e0 View commit details
    Browse the repository at this point in the history
  2. ✅(backend) drop JWT authentication in API tests

    Force login to bypass authorization checks when necessary.
    
    Note: Generating a session cookie through OIDC flow
    is not supported while testing our API.
    lebaudantoine committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    8f3e1dd View commit details
    Browse the repository at this point in the history
  3. ✏️(project) fix minor typos

    Found typos and fixed them.
    lebaudantoine committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    f8aba19 View commit details
    Browse the repository at this point in the history
  4. 🐛(project) run production image locally with docker-compose

    The local deployment of the Production image through docker-compose was
    failing due to issues in the Django configurations, influenced by Joanie.
    
    The bug stemmed from a dependency on a development-specific package
    (drf-spectacular-sidecar) while attempting to run the application in
    production mode.
    
    Changes Made:
    - Introduced new Django settings for local demo environments.
    lebaudantoine committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    0c4daf4 View commit details
    Browse the repository at this point in the history
  5. ✅(backend) test the authentication class

    Add tests on get_or_create method.
    lebaudantoine committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    0a14b5e View commit details
    Browse the repository at this point in the history
  6. 🚨(backend) fix minor linting issues

    Lint backend tests and sources.
    lebaudantoine committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    ceee0b7 View commit details
    Browse the repository at this point in the history