LikeCoin
WebsiteDiscord GitHubSupport Us
English
English
  • Decentralize Publishing
  • Liker Land FAQ
  • 📕DePub
    • Decentralized Publishing
    • Liker Land Affiliation Program
      • Stripe Connect Payout Account Status
    • FAQ: Listing ebooks
    • List ebook
      • List PDF
    • Manage ebooks
      • Manage Book Collection
      • Latest Books
      • Bulk create QR codes and Short URLs
      • NFT Authz Grants
      • ebooks Replenishment
      • Modify ebook
      • Burn ebook
    • Purchase ebooks
      • Gift an ebook
      • Read ebooks
      • Import ebook to ereaders
        • Import ebook to Kobo
      • Other ebook Platforms
        • Terminus Press
        • Dung Foo Kei
        • BookForest
    • Register on Liker Land
      • Resetting password
      • Securing your Liker ID
      • Manage logged in devices
      • Edit Avatar and Name
      • Export Wallet Seed Words
      • What is Authcore?
    • Liker Land features
      • My Bookshelf
      • Notifications
      • Follow Creators
      • NFT Details
    • Transfer NFT
      • Batch send NFT to supporters
    • NFT Tools
    • Writing NFT FAQ
    • Publish Writing NFT
      • Email/Social
      • Keplr
      • Cosmostation
      • Cosmostation app
      • Matters
      • Liker.Social
      • illustBuy
      • Publish NFT with ISCN ID
    • Collect Writing NFT
      • Collect Writing NFT by LIKE on desktop
      • Collect Writing NFT by LIKE on mobile
      • One-Click Collect All Writing NFT
      • NFT Widget
      • Dynamic Pricing
      • NFT Marketplace
    • ISCN
      • What is the relationship between ISCN and IPFS?
      • What's the point of decentralization to the content ecosystem?
      • What type of content is supported by ISCN?
      • How to register an ISCN?
        • Email/Social
        • Keplr
        • Cosmostation
        • Cosmostation app
        • Matters
      • Register ISCN in batch
      • ISCN Browser
  • 🧭General Guides
    • On the News
      • Interviews and Features
      • Activities and Events
      • Mentions
      • Awards and Press Release
      • Recommendations
    • Community
      • #Community Call
      • #open-a-ticket
      • #faucet-testnet
      • #translate-wallet-prefix
      • LikeCoin Discord wallet
      • LIKE this message
    • Faucet
    • Wallet
      • LIKE pay
      • Keplr Browser Extension Wallet
        • Install Keplr and create a new wallet
          • Creating a new Keplr wallet via setting up a new recovery phrase
        • Keplr: Deposit and Send LikeCoin
        • Keplr + dao.like.co: Deposit, send, delegate, governance
        • Import wallet into Keplr
      • Keplr Mobile Wallet
        • How to install Keplr Mobile
        • Keplr Mobile: Deposit and Send LikeCoin
        • Import wallet into Keplr Mobile
      • Cosmostation Browser Extension Wallet
        • How to install Cosmostation Browser Extension
        • Cosmostation: Deposit and Send LikeCoin
        • Cosmostation + dao.like.co: Deposit, send, delegate, governance
        • Import wallet into Cosmostation
      • Cosmostation Mobile Wallet
        • How to install Cosmostation app
        • Cosmostation app: Deposit and Send LikeCoin
        • Import wallet into Cosmostation app
      • Leap Browser Extension Wallet
        • How to install Leap Browser Extension
        • Leap: Deposit and Send LikeCoin
        • Import wallet into Leap
      • Multisig
      • Wallet Address
      • Block Explorer
        • dao.like.co
        • Ping.pub
        • ATOMScan
      • Transaction Fee
      • New LikeCoin address prefix "like" - FAQ
      • Migrating from ERC-20
        • Upgrade LikeCoin ERC-20 to LikeCoin chain
        • LikeCoin Migration FAQ
    • Trade
      • Buy LikeCoin
      • Trade in Osmosis
      • Registering on DigiFinex
      • Trade in DigiFinex
      • Trade in MyEthShop
      • OTC
    • Liquidity
      • Osmosis
    • Stake
      • Delegation of LikeCoin
        • Delegate on desktop
        • Delegate on mobile
      • Undelegation of LikeCoin
        • Undelegate on desktop
        • Undelegate on mobile
      • Redelegation of LikeCoin
        • Redelegate on desktop
        • Redelegate on mobile
      • Where comes the LikeCoin rewards?
    • Governance
      • Community Call
      • LikeCoin chain
      • Liquid Democracy
      • Proposal Deposit
      • Direct Voting
        • Vote on desktop
        • Vote on mobile
      • Validator
        • Community Delegation
        • Validator Report
      • Proposals
    • DApp
      • LikeCoin app
        • Download LikeCoin app
        • Like - Reinventing the Like
        • Super Like - Tweeting to the Space
      • Liker ID
        • Register a Liker ID with Keplr
        • Connecting to my social account
      • Civic Liker
        • How to be a Civic Liker
        • Civic Liker Settings
        • FAQ
        • Creators Fund
        • Rationale and benefits
        • ​Civic Liker Web3 Report
      • Web3Press
      • LikeCoin button
        • Matters
        • Self-Host
          • ghost
          • Hexo
          • Hugo
          • Jekyll
          • mdBook
          • October CMS
          • Others
        • Blogging Platforms
          • inmediahk.net
          • illustBuy
          • Tipga
          • Blink
          • Blogspot
          • SteemCN
          • Wix / Weebly
          • Write.as
      • Content Creator Tools
        • Rewards
        • Monthly Achievement
        • Creators Fund Report
        • Reward Release Time
        • Cannot get reward?
      • Liker.Social
      • depub.space
        • Share tweet from From LikeCoin Discord to depub.space
        • Avatar for depub.space
      • Glossary
    • Branding
      • Design Materials
  • 🔬Developer Guide
    • Developer Introduction
    • LikeCoin chain API
      • Cosmos concepts
      • RPC/LCD API
        • ISCN API
        • NFT API
      • Setup local test node
      • Sample
        • Javascript
        • CosmJS (Recommended)
          • Keplr
          • ISCN
    • LikeCoin API
      • Calling API
      • Authetication
      • Reference
    • LikeCoin button
      • Widget & Iframe
      • Javascript CDN
      • Javascript SDK
    • LIKE pay
      • Web Widget
        • Reference
        • Webhook
    • ISCN
      • Specification
      • Chain API
      • JavaScript
        • iscn-js
        • iscn-message-types
      • Web Widget
        • ISCN Widget
          • ISCN Widget Reference
        • ISCN x Arweave Widget
          • ISCN-AR Widget Reference
      • Batch upload tool
      • ISCN Badge
      • ISCN IPFS plugin
    • LikeCoin NFT
      • LikeCoin NFT Module Spec
      • Metadata best practice
      • Writing NFT Spec
      • NFT Book Spec
      • NFT Portal
        • NFT Portal Reference
      • API Reference
    • likecoin-js
    • Ecosystem Statistics Badge
    • Raise Proposal
  • 👥Validator Guide
    • Technical Introduction
    • LikeCoin chain node
      • Setup a node (mainnet / public testnet)
        • Node Security
        • Setup on docker (Deprecated)
        • Setup on cloud platforms
        • Syncing from genesis
      • Node configuration
      • Command line interface
        • Useful commands
    • Become a validator
    • ChungKing++ Upgrade
    • Previous upgrades
      • ChungKing+ Upgrade
      • ChungKing Upgrade
      • StarFerry Upgrade
      • LaiChiKok Upgrade
      • FoTan Upgrade
        • Overview
        • Software Changes Overview
        • For other full node operators
        • Miscellaneous
    • Legacy endpoints
Powered by GitBook
On this page
  • Introduction
  • 1. Format like.co OAuth parameters
  • 2. Redirect users to the formatted like.co OAuth page
  • 3. Exchange authorization_code for access_token
  • 4. Call API with access_token
Export as PDF
  1. Developer Guide
  2. LikeCoin API

Authetication

How to obtain access token for authenticated API using OAuth 2.0

Introduction

LikeCoin API uses OAuth2.0 flow for API authorization, through the following steps.

  1. Users authorize your app through web UIhttps://like.co/in/oauth. For details and params, please refer to like.co OAuth page section below

  2. Users are redirected back to a redirect_uri you own with a code, this code is used to exchange for a user access_token and refresh_token.

  3. Call APIs using access_token with proper scope. e.g. APIs in Like->info sections requires read:like.info or write:like.info grants.

AVAILABLE SCOPES:

Scope

Description

profile

Basic user public information

email

Access to user's email address

The following scope should be prepended with read: or write:

Scope

Description

(read|write):like

Access to all like related read/write scope

read:like.button

Access to read user like history and suggestions

write:like.button

Permission to like content for user

read:like.info

Access to read user liked authors, content suggestions, etc

TOKEN LIFE TIME

Access tokens expire in 1 hour. Refresh tokens do not expire, unless:

  1. Another new refresh token was issued for the same oauth client & user combination

  2. User revoked access

  3. OAuth client revoked the token via API

1. Format like.co OAuth parameters

https://like.co/in/oauth/?client_id={{CLIENT_ID}}&scope={{scope}}&redirect_uri={{redirectURI}}&state={{state}}

User will navigate to this page to authorize oauth, redirects back to redirect_uri with query paramauth_code and state if success

Param

Description

client_id

OAuth client id

scope

list of scope seperated by space, must be whitelisted, e.g. profile email

redirect_uri

redirect uri in URI compoenent encoded form, must be whitelisted

state

optional state provided by the service, that get passed back after authetication is success. Highly recommended for security reason.

2. Redirect users to the formatted like.co OAuth page

The page will prompt user to either login or register a Liker ID if they are not logged in. Users logged in will then be shown the OAuth client's info and permissions asked. authorization_code and other response will be sent in query string to redirect_uri should users accept the permission, or error denied will be returned instead.

3. Exchange authorization_code for access_token

POST https://api.like.co/oauth/access_token

After user oauth login in client, exchange authorization_code in callback uri for access_token

Headers

Name
Type
Description

Content-Type

string

application/x-www-form-urlencoded

Request Body

Name
Type
Description

client_id

string

OAuth client id

client_secret

string

OAuth client secret

grant_type

string

authorization_code

code

string

The authorization code received in redirect_uri

redirect_uri

string

The redirect_uri param in original request

{
  "user": "williamchonggoogle",
  "displayName": "William Chong",
  "avatar": "https://storage.googleapis.com/likecoin-develop.appspot.com/likecoin_store_user_williamchonggoogle_test?GoogleAccessId=firebase-adminsdk-b93f2%40likecoin-develop.iam.gserviceaccount.com&Expires=2430432000&Signature=uJzHlCKDU9azuN5jbHVXToc2OsmPqJ0g4Q%2F3fhgJWBVK2f9brU%2FqYkx9ugVyNARugxxyCsfPX5a4jobhpI7jz%2FCy322RHv1TKPPePpQWstD46EhtFXwb8k2Q0HE65%2FO9yK69qvj08hSSvALFwk3oVObKw9D21mN5NLmar%2B9ZSxgl%2BBL%2BBfHp3cDEThZ%2FzMTHKSdOnrsSaH8Nrg7Y0wqzExzpc%2BaA158GDMAeJJwLWznXdrAI6Sd2CLMLW6ER%2FtdlTKQNbOEhiYElRLCC%2FBlS9jAjov7u%2BsifKEc7mADDum2dabBTBG69WusrgT8IrdBq2Hb6l05HI1AeRrlD8jeR5w%3D%3D",
  "refresh_token": "j31UBpMTdt-zaqVrCUJ0Ap8ulbosoPUGS8rVls_QYBg",
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoid2lsbGlhbWNob25nZ29vZ2xlIiwic2NvcGUiOlsicHJvZmlsZSIsInJlYWQ6bGlrZSIsIndyaXRlOmxpa2UiXSwiYXpwIjoiMmY1NTFkNWZlMWFkNjU3NzNhMTciLCJpYXQiOjE1NTIwNDE3NDYsImV4cCI6MTU1MjA0NTM0NiwiYXVkIjoicmlua2VieS5saWtlLmNvIiwiaXNzIjoicmlua2VieS5saWtlLmNvIiwianRpIjoiMGJjN2Q1NGYtOWViYS00ODczLWFiYWUtMzc1ZTczYzExZTMwIn0.BPNsiQb0fs2fFjiSQWUq8oeE4FL_PLebdTRDpSh7n9k"
}

4. Call API with access_token

Call authenticated API with header Authorization valueBearer {{access_token}}

PreviousCalling APINextReference

Last updated 5 years ago

🔬