Skip to content

Feature/add hook custom params - #156

Merged
gvwilson merged 8 commits into
plotly:mainfrom
clement-chaneching:feature/add-hook-custom-params
Jan 8, 2025
Merged

gvwilson merged 8 commits into
plotly:mainfrom
clement-chaneching:feature/add-hook-custom-params

Conversation

@clement-chaneching

@clement-chaneching clement-chaneching commented Oct 29, 2024 •

Copy link
Copy Markdown
Contributor

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)

For example, this would help to retrieve the "IDP" attribute so that we can manage permissions accordingly

Comment thread dash_auth/oidc_auth.py Resolved

@RenaudLN RenaudLN left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, a few small comments :)

Comment thread dash_auth/oidc_auth.py Resolved
Comment thread dash_auth/oidc_auth.py Resolved
Comment thread dash_auth/oidc_auth.py Resolved
Comment thread dash_auth/oidc_auth.py Resolved
Comment thread dash_auth/oidc_auth.py Resolved

@RenaudLN RenaudLN left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

Just need to fix the linting, max 79 characters per line in this repo

@RenaudLN RenaudLN left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually, before approving, this ability should be documented somewhere. Can you add something in the class docstring to show the pattern with subclassing and overriding the after_logged_in method?

@RenaudLN RenaudLN left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@RenaudLN

RenaudLN commented Nov 8, 2024

Copy link
Copy Markdown
Contributor

@alexcjohnson would you have some time to give this one a look? It is handy to give devs the possibility to hook into the login process.

@alexcjohnson

Copy link
Copy Markdown
Collaborator

Looks reasonable to me. Probably good though to let either @gvwilson or @ndrezn take a look.

@clement-chaneching

Copy link
Copy Markdown
Contributor Author

@alexcjohnson,
Could we merge this one and tag a new minor version?
This would help retrieving specific attributes after logging in from different Idps.
Thanks!

@clement-chaneching

Copy link
Copy Markdown
Contributor Author

Chasing up on this one @alexcjohnson

@gvwilson gvwilson self-assigned this Dec 19, 2024
@gvwilson

Copy link
Copy Markdown
Contributor

Hi @clement-chaneching - my apologies for the delay at our end - we've been trying to get the new versions of plotly.js, plotly.py, and Dash wrapped up, and it has taken longer than expected. We have a meeting on January 7 to discuss contributions like this, so I've added a note to my calendar to get back to you on Wednesday January 8 about this. If you'd like to email me (greg.wilson@plot.ly) so that I have your address, I'd be happy to ping you that way as well. Thanks - @gvwilson

@gvwilson
gvwilson merged commit 99b94c0 into plotly:main Jan 8, 2025
@gvwilson

gvwilson commented Jan 8, 2025

Copy link
Copy Markdown
Contributor

Hi again @clement-chaneching - apologies once more for the delay in merging this, and thank you again for your contribution.

@clement-chaneching

Copy link
Copy Markdown
Contributor Author

Thanks! Nothing urgent, but let me know when a new minor tag will be released with this change.

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.

4 participants