Ueberauth Weibo v0.0.2 Ueberauth.Strategy.Weibo.OAuth

An implementation of OAuth2 for weibo.

To add your client_id and client_secret include these values in your configuration.

config :ueberauth, Ueberauth.Strategy.Weibo.OAuth,
  client_id: System.get_env("GITHUB_CLIENT_ID"),
  client_secret: System.get_env("GITHUB_CLIENT_SECRET")

Summary

Functions

Provides the authorize url for the request phase of Ueberauth. No need to call this usually

Construct a client for requests to Weibo

Calls OAuth2 Client to get access token. Weibo requires Content-Type header as ‘x-www-form-urlencoded’ while returns body as JSON string: :body=>”{“access_token”:”2.xxx”,”expires_in”:86400,”uid”:”12345”}”. As a result, response cannot not be parsed correctly. A temp fix is to build a new access token using decoded dict

Functions

authorize_url(client, params)
authorize_url!(params \\ [], opts \\ [])

Provides the authorize url for the request phase of Ueberauth. No need to call this usually.

client(opts \\ [])

Construct a client for requests to Weibo.

Optionally include any OAuth2 options here to be merged with the defaults.

Ueberauth.Strategy.Weibo.OAuth.client(redirect_uri: "http://localhost:4000/auth/weibo/callback")

This will be setup automatically for you in Ueberauth.Strategy.Weibo. These options are only useful for usage outside the normal callback phase of Ueberauth.

get_access_token(token, arg2)
get_token(client, params, headers)
get_token!(params \\ [], options \\ %{})

Calls OAuth2 Client to get access token. Weibo requires Content-Type header as ‘x-www-form-urlencoded’ while returns body as JSON string: :body=>”{“access_token”:”2.xxx”,”expires_in”:86400,”uid”:”12345”}”. As a result, response cannot not be parsed correctly. A temp fix is to build a new access token using decoded dict.