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

Add a simple example implementing authentication and few requests #92

Open
klozovin opened this issue Jan 10, 2018 · 5 comments
Open

Add a simple example implementing authentication and few requests #92

klozovin opened this issue Jan 10, 2018 · 5 comments

Comments

@klozovin
Copy link

Would it be possible to add to examples a simple, runnable from console, example that shows how to (for example):

  1. Obtain OAuth URL for Web Application credentials (I don't see how formURL can do that)
  2. Open that URL in browser and let the user authorize the app and paste back the OAuthCode
  3. Using the authentication code retrieve the Access Token and Refresh Token
  4. Do simple request (for example fetch YouTube subscriptions) using the Access Token
  5. Using the Refresh Token acquire a new Access Token
  6. Do another request using the new Access Token

I've just spent a better part of a day trying to do something similar to this, but couldn't even get past authentication. For those well versed in advanced Haskell type magic they can probably put this together just reading type signatures, but for beginners it's practically impenetrable. Entire gogol-* system of libraries seems amazing and feature-full, but it's really hard to get started.

@dgaw
Copy link

dgaw commented Apr 23, 2018

@kmelva Did you get anywhere with this? I would really appreciate an example like you described.

@saurabhnanda
Copy link

@brendanhay this is something that I'd like to help with. It's scratching my own itch. Every newbie in my team has struggled with the gogol-* family of libraries. In fact, even I have spent the last couple of hours looking at http://hackage.haskell.org/package/gogol-0.3.0/docs/Network-Google-Auth.html and http://hackage.haskell.org/package/gogol-0.3.0/docs/Network-Google-Auth-InstalledApplication.html and have realised that Gogol doesn't really solve the "most common" use-case for server-side webapps: https://developers.google.com/identity/protocols/OAuth2WebServer

Is my understanding correct?

@saurabhnanda
Copy link

@brendanhay Is there any reason why http://hackage.haskell.org/package/gogol-0.3.0/docs/Network-Google-Auth.html#t:Credentials & http://hackage.haskell.org/package/gogol-0.3.0/docs/Network-Google-Auth-InstalledApplication.html#v:redirectURI can't be extended to also allow Gogol to support "Web Server Applications"?

I've spent quite some time today understanding how Gogol & Google-OAuth works, and feel that changing a few URL params here & there can get this to work. Shall I attempt a PR?

@NorfairKing
Copy link

@saurabhnanda +1 on this

@tonicebrian
Copy link
Collaborator

Hi @saurabhnanda I'm collaborating in getting Gogol in shape. If you are still thinking about contributing, please create a PR and I will have a look at it.

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

No branches or pull requests

5 participants