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

Lazily get token for clients #63

Open
mattheworiordan opened this issue Oct 31, 2018 · 5 comments
Open

Lazily get token for clients #63

mattheworiordan opened this issue Oct 31, 2018 · 5 comments

Comments

@mattheworiordan
Copy link
Member

mattheworiordan commented Oct 31, 2018

It seems that the Java and JS libs obtain tokens automatically if token authentication is required for the client (authUrl specified for example), even if autoConnect is false.

I think this is wrong. Why obtain a token until it's needed?

┆Issue is synchronized with this Jira Task by Unito

@SimonWoolf
Copy link
Member

It seems that the Java and JS libs obtain tokens automatically if token authentication is required for the client (authUrl specified for example), even if autoConnect is false.

Can't speak to the java lib, but for the JS lib, I can assure you it doesn't, not sure why you and Srushtika are convinced otherwise. The client lib constructor does nothing that triggers getting an auth token, it's all done the first time something (a rest request or a connect()) calls getAuthParams() or getAuthHeaders().

I've just tried it as a sanity check; it really doesn't.

@mattheworiordan
Copy link
Member Author

not sure why you and Srushtika are convinced otherwise

Because that is what @paddybyers told me, and he wrote both the libs initially 😄

The client lib constructor does nothing that triggers getting an auth token, it's all done the first time something (a rest request or a connect()) calls getAuthParams() or getAuthHeaders().

Great, that's what it should do. So this is perhaps just a Java issue if Java doesn't do this @paddybyers? Is it worth clarifying in the spec given most of the libs probably behave as they should then?

@paddybyers
Copy link
Member

So this is perhaps just a Java issue if Java doesn't do this @paddybyers?

In fact the java library does it lazily as well.

Is it worth clarifying in the spec given most of the libs probably behave as they should then?

There's nothing in the spec that says explicitly one way or the other. I think it is probably worth clarifying.

@tomczoink
Copy link
Contributor

@mattheworiordan is this still something we're wanting to clarify in the spec?

@QuintinWillison QuintinWillison transferred this issue from ably/docs Oct 3, 2022
@sync-by-unito
Copy link

sync-by-unito bot commented Oct 17, 2022

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-2808

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants