question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rename TokenClientExtensions.Request*Async

See original GitHub issue

TokenClient has several extension methods whose names are misleading:

  • RequestAuthorizationCodeAsync
  • RequestRefreshTokenAsync
  • RequestClientCredentialsAsync
  • RequestResourceOwnerPasswordAsync
  • etc

The method names seem to imply that the method “requests an authorization code” or “requests a refresh token”, which is not true. It actually requests a token using an authorization code, or a refresh token.

Since I see there’s a new major version in the works, it could be an opportunity to take the breaking change and rename those methods to something more accurate.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
thomaslevesquecommented, Dec 11, 2018

Well - naming is hard

Indeed it is. But don’t you think something like RequestTokenUsingAuthorizationCode would be less confusing? Maybe ask around you and see what people think 😉

1reaction
thomaslevesquecommented, Dec 11, 2018

Thanks @leastprivilege

TokenClient is deprecated.

If you want to review code, use the v4 branch.

What is used instead of TokenClient then? I still see it in the v4 branch. It looks like the extension methods I mentioned are now instance methods, but they still have misleading names.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Token lifetime handling · Issue #118 · dotnet-architecture ...
When you have the token, you can know its expiration date and if it is about to expire you can use the refresh...
Read more >
c# - Retrying HttpClient Unsuccessful Requests
SendAsync(request, cancellationToken)); } using (var client = new ... sample usage: var response = await RequestAsync(() => httpClient.
Read more >
No rename token? What's wrong with my username? Bug
I just downloaded Warzone and tried loading up. It's trying to make me change my name from something that is literally just a...
Read more >
All modules
All modules: · application · avro-schema · base · config-schema · crypto · crypto-extensions · db-schema · ledger-common.
Read more >
octokit/rest.js
The name of the repository without the .git extension. ... OAuth Apps must use basic authentication with their client ID and client secret...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found