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

Update Documentation #37

Closed
hayribakici opened this issue Mar 30, 2020 · 7 comments
Closed

Update Documentation #37

hayribakici opened this issue Mar 30, 2020 · 7 comments
Labels

Comments

@hayribakici
Copy link
Collaborator

Hi,

is there any better documentation on how to use this library through OAuth? It seems like the README.md and the code are inconsistent. It would be nice to test certain features I am currently developing before merging.

@hayribakici hayribakici mentioned this issue Mar 30, 2020
@rinukkusu
Copy link
Owner

Hi @hayribakici, I've not used it myself, maybe @LeviHassel has some insights and mybe we can update the documentation based on that!

@LeviHassel
Copy link
Collaborator

Hi @hayribakici, connecting through OAuth is unfortunately not a straightforward process and it took me a long time to figure it out. I might be able to help if you can answer a few questions for me.

  1. What inconsistencies are you seeing between the README and the code?
  2. Are you trying to connect through the Authorization Code flow? If so, is it the "imaginary" redirect and listen methods that are tripping you up?
  3. What type of application are you using this package for? i.e. Flutter app, Dart Native etc.

@hayribakici
Copy link
Collaborator Author

Hi,

thanks for the reply.

  1. so in the README it says
...
  final requestUri = ...
  return SpotifyApi.fromAuthCodeGrant(WelcomeScreen.grant, requestUri);

But in the code fromAuthCodeGrant() requires a responseUri. So, there was a little confusion there.

  1. Yes, I am trying to authorize myself throught the Authorization Code flow. Indeed, the 'imaginary' methods are the problem. I also looked into the OAuth documentation and their example is pretty much the same. :)
    It just would be nice to know, what to there exactly.

  2. I am not using this library in any application. I created this PR Devices API #36 and I just wanted to to test it in the example.dart. Since the device API needs Authorization, I stumbled upon the authorization issue.

@LeviHassel
Copy link
Collaborator

Thanks for all of the info @hayribakici!

I just put up #41, which addresses the requestUri/responseUri confusion and should hopefully clear up the auth process a bit. I'm sure it's not as concrete of an example as you were hoping for, but there's not a one-size-fits-all example for connecting through OAuth.

As you can see in dart-lang/oauth2#53, there's plenty of confusion around the imaginary methods in the oauth2 package as well. One commenter in that thread made https://github.com/Alacon/flutter_oauth2_client, which is very similar to how I do the Authorization Code Flow in my Flutter app. If we made our own version of that repo (something like flutter_spotify_client), we'd be able to quickly test changes like yours.

@hayribakici
Copy link
Collaborator Author

Thank you for all the insights @LeviHassel. I'll take a look at this soon.

@hayribakici
Copy link
Collaborator Author

@rinukkusu I think this issue can be closed or should I do it?

@rinukkusu
Copy link
Owner

I assume everything is clear for you now - so yes, I'll close it :)

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

No branches or pull requests

3 participants