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

💬 RFC: Make the usage of OAuth Access Token more stable/predictable #24815

Open
2 tasks done
acierto opened this issue May 17, 2024 · 2 comments
Open
2 tasks done

💬 RFC: Make the usage of OAuth Access Token more stable/predictable #24815

acierto opened this issue May 17, 2024 · 2 comments
Labels
auth rfc Request For Comment(s)

Comments

@acierto
Copy link
Contributor

acierto commented May 17, 2024

🔖 Need

Current issue:

If to open Backstage in 2 different tabs and perform ScmAuthApi.getCredentials in each tab, the token on tab 1 will be revoked. The problem lies that the session lives only in memory and the session manager doesn't reuse it.

It's not unique when users can open Backstage in multiple tabs or in different browsers, in order to perform different scenarios in each browser session.

🎉 Proposal

The proposal is to store the OAuth session in the database, for example in backstage_plugin_auth database in a new table oauth_session or something like this.

〽️ Alternatives

No response

❌ Risks

Such tokens are short lived, i.e. GitLab token can be valid maximum for 2 hours.

👀 Have you spent some time to check if this RFC has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@acierto acierto added rfc Request For Comment(s) auth labels May 17, 2024
@Rugvip
Copy link
Member

Rugvip commented May 17, 2024

Which provider is it that you're seeing this for? The token being revoked is something that shouldn't happen regardless of whether we have backend storage or not. Agree that that would be a good addition though 👍

There are some potential fixes for this on the way in #24743 too, I spotted some bugs for the refresh endpoint of some providers as part of that refactor.

@acierto
Copy link
Contributor Author

acierto commented May 17, 2024

I see it for GitLab provider.
I could reproduce it by opening 2 different scaffolder templates in separate tabs, where both require to get an access token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth rfc Request For Comment(s)
Projects
None yet
Development

No branches or pull requests

2 participants