-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Should there be something like AuthProvider.getSession(args)
#91546
Comments
On another look I would also question why providers are exposed and why we don't have a function on the namespace. export namespace authentication {
export function registerAuthenticationProvider(provider: AuthenticationProvider): Disposable;
export const onDidChangeAuthenticationProviders: Event<AuthenticationProvidersChangeEvent>;
export function getSession(providerId:string, scopes:string[]) : Thenable<Session>;
} This would be much more in line with how file system providers work - with them you register a file system for a scheme and consumers/clients go through |
Settings sync uses this on start up. If sync is on, it checks if there is an available session and uses it. If not, it shows an indicator on the gear for the user to sign in, waiting for the user to take action instead of popping open a browser window immediately. If we move to exposing a function instead of providers, we also need to expose login, logout, and the session change event. I had moved to that model at one point, but then changed back because it was very verbose. |
Which means there is a need for
Not sure I understand - it cannot be more than what the providers have and we have the chance to add utils around the provider so that extensions don't need to write boiler plate code (like finding a session)
Wanted to ask about |
Yes, correct. The argument for moving back to only exposing "providers" was something along the lines that it was simplifying/cleaner, it created less API. I don't really have strong opinions either way, I just would like to decide on something and stop switching it back and forth :) I agree about |
Closing since we have finalized on a single |
re #91309
The test plan item defines
getCachedSesssionOrLogin
, my sample extension does something similar so that makes me think if there should be just something likeAuthenticationProvider.getSession(scopes:string[])
which (a) picks a matching session if available or (b) does the login-dance. What's the use-case for having the sessions-array?The text was updated successfully, but these errors were encountered: