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

Document the recommended way of getting an AppAuthClient #156

Open
okkero opened this issue Sep 9, 2024 · 1 comment · May be fixed by #162
Open

Document the recommended way of getting an AppAuthClient #156

okkero opened this issue Sep 9, 2024 · 1 comment · May be fixed by #162
Labels
enhancement New feature or request question Further information is requested

Comments

@okkero
Copy link

okkero commented Sep 9, 2024

I am trying to authenticate using basic auth with app key and app secret. The way I understand it is that AppAuthClient is meant to be used for that. I read through the documentation and came across this: The default client has implementations of all of these (except for AppAuthClient currently). Now, I was wondering if there is a recommended alternative to get a hold of an AppAuthClient, and if there is, if it could be documented somewhere.

Sorry if I'm missing something obvious. I tried quickly putting together one myself, backed by a NoAuthClient, thinking I could just add the required auth header before the backing client takes care of the rest, but I found no way to do that last bit.

Versions

  • What version of the SDK are you using? 0.18.1
  • What version of the language are you using? 1.80.1

Additional context
My current approach is to just copy a bunch of the code from https://github.com/dropbox/dropbox-sdk-rust/blob/master/src/default_client.rs until I have something that works mostly like the other clients but with the correct auth. Very much a hack which I would like to avoid if possible.

@okkero okkero added the question Further information is requested label Sep 9, 2024
@wfraser
Copy link
Member

wfraser commented Nov 6, 2024

First, check that App auth is actually what you want. There are very few things you can do with only app auth:

  • auth/token_from_oauth1
  • files/get_thumbnail_v2
  • files/list_folder and files/list_folder_continue
  • sharing/get_shared_link_metadata

and that's it. Usually you want user or team auth instead.

If you do really need app auth, then you're correct, this hasn't been implemented here (yet). Basically you'd need to use the default no-auth client and set an appropriate Authorization: Basic <base64...> header on each request.

If I get a bit of spare time I can probably just add it; it's pretty easy at this point.

@wfraser wfraser added the enhancement New feature or request label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants