Quick Exchange
  • Quick Exchange for Partners
  • Expired Quote Handling
  • Widget Integration
    • Embedded Widget
    • Configuration
      • Config Version
      • Settlement Defaults
      • Settlement Parameters
      • Custom Styles
      • Identity
      • Special Layout
      • Partner Fields
    • Event Hooks
  • API Integration
    • Authentication
    • User Session
      • OAuth
      • KYC
    • Settlements
  • Settlements
    • Funding Methods
      • BLOCKCHAIN_TRANSFER
      • BLOCKCHAIN_DELEGATED_BROADCAST
      • CARD_PAYMENT
        • Test Cards
    • Payout Methods
      • BLOCKCHAIN_TRANSFER
      • LIQUID_PARTNER_WALLET
      • LIQUID_WALLET
      • LIQUID_USER_WALLET
  • E-Commerce
    • X-Quoine-Auth
    • Intents (Fixed Settlements)
      • Deliverable Currency
    • Transactions
      • Transaction Status
Powered by GitBook
On this page
  • Structure
  • Usage

Was this helpful?

  1. API Integration
  2. User Session

OAuth

Authenticate users as a liquid user by briefly redirecting the browser to a specified url.

PreviousUser SessionNextKYC

Last updated 4 years ago

Was this helpful?

Structure

In the context of QEX, OAuth can only be used to authenticate a session generated by the QEX API. This session can then be used to query the QEX API and/or initialize a widget integration.

Usage

1. Create Session

A session can be created

POST https://partners.liquid.com/api/v1/session
{
  "public_api_key": "pk_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

200 
{
   "success":true,
   "environment":"PRODUCTION",
   "message":"Session created.",
   "payload":{   
      "public_api_key":"pk_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "session_id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",      
      "session_secret":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      "environment":"PRODUCTION",
      "client_info":{
         "ip_country":"JP"
      },
      "_links":{
         "terms_of_service":{
            "href":"https://help.liquid.com/en/articles/3969828-quick-exchange-by-liquid-end-user-terms-of-use"
         }
      }
   }
}

2. Associate session to User

Once a session has been created it can be associated with a user by having them approve the OAuth request. This is done by opening a browser window to the URL below.

https://partners.liquid.com/api/v1/session/{session_id}/liquid_oauth

Note: when OAuth is completed the user will be presented with an instruction to close the web browser and manually return to your app.

This can alternatively redirect the user to a specified URL or deep link.

3. Fetch user account balances

GET https://partners.liquid.com/api/v1/session/${session_id}/accounts
Authorization: Bearer {jwt}

4. Initialize Widget

{
  "public_api_key": "pk_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  ...
  "identity": {
    "user_session": {
      "session_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "session_secret": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
  }
}

The authenticated session can now be used to query the user account balances. See .

The session id/key can be . This will cause the widget to assume the session of the user authenticated earlier.

See swagger
Authorization
via API.
passed into the widget