8000 [BREAKING CHANGE] Sync external user with database at login time by celian-garcia · Pull Request #1692 · perses/perses · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[BREAKING CHANGE] Sync external user with database at login time #1692

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

Conversation

celian-garcia
Copy link
Member
@celian-garcia celian-garcia commented Jan 9, 2024

Description

This PR add the last important missing brick which consist in saving the user once logged in.
It allows then to add some permissions to that user.

Screenshots

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.
  • Visual tests are stable and unlikely to be flaky.
    See Storybook
    and e2e docs for more details. Common issues
    include:
    • Is the data inconsistent? You need to mock API requests.
    • Does the time change? You need to use consistent time values or mock time utilities.
    • Does it have loading states? You need to wait for loading to complete.

@celian-garcia celian-garcia force-pushed the feat/external-auth-sync-db-bis branch 4 times, most recently from bbca725 to 727e592 Compare January 10, 2024 11:25
@celian-garcia celian-garcia force-pushed the feat/external-auth-sync-db-bis branch 2 times, most recently from c5aacdc to 2a94ad5 Compare January 10, 2024 13:13
@celian-garcia celian-garcia changed the title [FEATURE] Sync external user with database at login time [BREAKING CHANGE] Sync external user with database at login time Jan 10, 2024
@celian-garcia celian-garcia marked this pull request as ready for review January 10, 2024 13:16
@celian-garcia celian-garcia force-pushed the feat/external-auth-sync-db-bis branch from 2a94ad5 to 13adfef Compare January 10, 2024 13:29
@celian-garcia celian-garcia self-assigned this Jan 10, 2024
@celian-garcia celian-garcia added ui Related to the Frontend api Related to the API (backend) labels Jan 10, 2024
Copy link
Member
@Nexucis Nexucis left a comment

Choose a reason for hiding this comment

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

nice to see we are reaching a first version of OIDC/OAUTH support !!!

@Nexucis
Copy link
Member
Nexucis commented Jan 10, 2024

from private tchat with @celian-garcia, because I think it will be nice to have a trace of what we decided :

I still foresee two problems
the fact to return 500 error when something is wrong. The login with external oauth providers is not really a rest API flow as we're used to. This is more frontend oriented with GET and redirections.
=> Shall I redirect to "/"instead of returning a 500 error

well you can do both I think. And error is needed to know what happens.
For the redirection, would be interesting why you would like to redirect to the home page if the loggin failed. Because there is an automatic redirection in the frontend to the login page if there is no token stored in the cookies.

When there's only one oauth provider and no native provider, I removed the step of the perses signin page. I think it's a bad idea as the logout is logging us in again automatically.
=> Shall I get back the perses signin page when there is only one oauth provider and no native provider?

Yeah I think it's better if the login page is there whatever is the provider enabled. Specially because like said above, there is a redirection to the login page when you are logged.

@celian-garcia
Copy link
Member Author
celian-garcia commented Jan 10, 2024

from private tchat with @celian-garcia, because I think it will be nice to have a trace of what we decided :

I still foresee two problems
the fact to return 500 error when something is wrong. The login with external oauth providers is not really a rest API flow as we're used to. This is more frontend oriented with GET and redirections.
=> Shall I redirect to "/"instead of returning a 500 error

well you can do both I think. And error is needed to know what happens. For the redirection, would be interesting why you would like to redirect to the home page if the loggin failed. Because there is an automatic redirection in the frontend to the login page if there is no token stored in the cookies.

Yes it is to be then redirected by the frontend itself. The current issue is that it returns 500 and display 500 Internal Server Error to the browser.
We could also return a web page with a button to go back to "/"or go back to "/signin"

When there's only one oauth provider and no native provider, I removed the step of the perses signin page. I think it's a bad idea as the logout is logging us in again automatically.
=> Shall I get back the perses signin page when there is only one oauth provider and no native provider?

Yeah I think it's better if the login page is there whatever is the provider enabled. Specially because like said above, there is a redirection to the login page when you are logged.

👍 alright we agree on that, I will remove the line that does the auto redirect.

@celian-garcia celian-garcia force-pushed the feat/external-auth-sync-db-bis branch 2 times, most recently from b5a3eb0 to e0008ec Compare January 10, 2024 15:50
Signed-off-by: Celian GARCIA <celian.garcia@amadeus.com>
@celian-garcia celian-garcia force-pushed the feat/external-auth-sync-db-bis branch from e0008ec to 868601d Compare January 10, 2024 16:08
Copy link
Member
@Nexucis Nexucis left a comment

Choose a reason for hiding this comment

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

🥳

@Nexucis Nexucis merged commit d1732cf into perses:feat/social-authentication Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to the API (backend) ui Related to the Frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0