Popularity
6.5
Growing
Activity
0.0
Stable
9
4
7

Monthly Downloads: 5
Programming language: Haskell
License: MIT License
Tags: Google     Unclassified    
Latest version: v0.3.0.0

google-oauth2 alternatives and similar packages

Based on the "Unclassified" category.
Alternatively, view google-oauth2 alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of google-oauth2 or a related project?

Add another 'Unclassified' Package

README

Google OAuth2

Interactive Google OAuth2 token negotiation

Usage

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}

module Main (main) where

import Data.Aeson
import Data.Semigroup ((<>))
import Network.Google.OAuth2
import Network.HTTP.Simple
import Network.OAuth.OAuth2
import Data.Text.Encoding (encodeUtf8)

main :: IO ()
main = do
    OAuth2Token{..} <-
      getAccessToken
        "<CLIENT_ID>"      -- Fill with real ID.
        "<CLIENT_SECRET>"  -- Fill with real code.
        ["https://www.googleapis.com/auth/drive"]
        (Just "path/to/credentials.cache")

    request <- parseRequest "https://www.googleapis.com/drive/v2/files"
    response <- httpJSON $ authorize (atoken accessToken) request

    print (getResponseBody response :: Value)
 where
   authorize token = setRequestHeaders
       [ ("Authorization", encodeUtf8 $ "Bearer " <> token)
       ]

Prior Art

This module was inspired by handa-gdata which appears to be abandoned.


[CHANGELOG](./CHANGELOG.md) | [LICENSE](./LICENSE)


*Note that all licence references and agreements mentioned in the google-oauth2 README section above are relevant to that project's source code only.