-
Notifications
You must be signed in to change notification settings - Fork 205
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
[PY] feat: SSO - auth-sign-in #1976
[PY] feat: SSO - auth-sign-in #1976
Conversation
|
in application.ts, getTokenOrStartSignIn(),... does deleteUserInSignInFlow and setUserInSignInFlow, etc.. In app.py, get_token_or_sign_in_user(),... does not directly do these things. Here the "insigninflow" is captured at the top.
In the python get_token_or_sign_in(), _authenticate_user() is called when a token is not already available. So I think we are aligned with the notes from the TS getTokenOrStartSignIn() on this topic.
|
I think the method is looking alright, but I still need to write tests @lilyydu |
@BMS-geodev could you update the PR style (update title of PR) to follow our contribution guidelines? Thanks! |
@corinagum done, apologies |
@lilyydu wrote 4 tests that circle around get_token_or_sign_in_user(), and added them to test_app.py test_get_token_or_sign_in_user_token_exists |
Linked issues
closes: #1318
Details
Added the get_token_or_sign_in_user() method. It is the interaction entrypoint for the sso authentication.
It is modeled after the JS version of this functionality.
If the user is signed in, get the access token.
If not, triggers the sign in flow for the provided authentication setting name and returns.
In this case, the bot should end the turn until the sign in flow is completed.
Change details
code snippets:
screenshots:
Attestation Checklist
My code follows the style guidelines of this project
I have checked for/fixed spelling, linting, and other errors
I have commented my code for clarity
I have made corresponding changes to the documentation (updating the doc strings in the code is sufficient)
My changes generate no new warnings
I have added tests that validates my changes, and provides sufficient test coverage. I have tested with:
New and existing unit tests pass locally with my changes
Additional information