View Source Ueberauth.Strategy.Tiktok.OAuth (ueberauth_tiktok v0.1.0)
An implementation of OAuth2 for Tiktok.
To add your :client_key
and :client_secret
include these values in your
configuration:
config :ueberauth, Ueberauth.Strategy.Tiktok.OAuth,
client_key: System.get_env("TIKTOK_CLIENT_KEY"),
client_secret: System.get_env("TIKTOK_CLIENT_SECRET")
Summary
Functions
Callback implementation for OAuth2.Strategy.authorize_url/2
.
Provides the authorize url for the request phase of Ueberauth.
Construct a client for requests to Tiktok.
Makes a GET request to the specified URL using the provided Tiktok token.
Callback implementation for OAuth2.Strategy.get_token/3
.
Fetches the access token from Tiktok.
Functions
Callback implementation for OAuth2.Strategy.authorize_url/2
.
Provides the authorize url for the request phase of Ueberauth.
Construct a client for requests to Tiktok.
Optionally include any OAuth2 options here to be merged with the defaults:
Ueberauth.Strategy.Tiktok.OAuth.client(
redirect_uri: "http://localhost:4000/auth/tiktok/callback"
)
This will be setup automatically for you in Ueberauth.Strategy.Tiktok
.
These options are only useful for usage outside the normal callback phase of Ueberauth.
Makes a GET request to the specified URL using the provided Tiktok token.
Parameters
token
(String): The OAuth token to be used for authentication.url
(String): The URL to which the GET request is made.headers
(List, optional): A list of headers to include in the request. Defaults to an empty list.opts
(List, optional): A list of options to customize the request. Defaults to an empty list.
Returns
- The response from the OAuth2 client.
Examples
iex> get("your_token", "/user/info/?fields=open_id,union_id,avatar_url,display_name")
%OAuth2.Response{status_code: 200, body: %{"data" => %{"user" => %{"avatar_url" => "https://example.com/avatar.jpg", "display_name" => "Shapath Neupane"}}}}
Callback implementation for OAuth2.Strategy.get_token/3
.
Fetches the access token from Tiktok.