plotly / plotly/dash-auth

Release of the post login hook with OIDC

Open
#167 2 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
135
Forks
67
PR merge metrics
No merged PRs in 30d

Description

I was trying to implement some post login logic by following the instructions in the after_logged_in method from @clement-chaneching (https://github.com/plotly/dash-auth/blob/main/dash_auth/oidc_auth.py#L273), but could not get it to work.

 """
       Post-login actions after successful OIDC authentication.
       For example, allows to pass custom attributes to the user session:
       class MyOIDCAuth(OIDCAuth):
           def after_logged_in(self, user, idp, token):
               if user:
                   user["params"] = value1
               return super().after_logged_in(user, idp, token)
"""

I realized that this code was not released... Are there any plans for a new release integrating the latest changes to the package ?

Based on the code from 2.3.0, I ended up having to reset the server url rule for the OIDC callback in the __init__ of a MyOIDCAuth class, providing an overriden callback method (which then returns the overriden after_logged_in method). Without this my new after_logged_in method was never called (but it's possible I'm just confused about how inheritance works in this case).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review dash_auth/oidc_auth.py around the after_logged_in example at line 273 and compare it with the released 2.3.0 behavior. Trace how the OIDC callback invokes after_logged_in, then inspect the repository's release process if available. Done means the documented hook is included in a published release and its callback behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authentication
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.