OAuth 2.0 Authentication
Landing supports OAuth 2.0 authentication for secure third-party integrations. This guide will walk you through the process of setting up OAuth authentication for your application.OAuth integration is only available for projects on a paid plan.
1. Create an OAuth Application
Contact support@landing.so to create a new OAuth application. You will receive:- Client ID
- Client Secret
- Authorized redirect URIs
2. Redirect Users to Landing’s Authorization Page
When a user wants to authorize your application, redirect them to Landing’s authorization URL with the correct parameters:
Optional Parameters:
Available Scopes:
project.read- Read access to projectspages.read- Read access to pagesleads.read- Read access to leadsuser.read- Read access to user information (default)
3. Handle the Authorization Response
After the user approves your application, they will be redirected back to your specifiedredirect_uri with an authorization code:
state parameter matches the one you sent in step 2 to prevent CSRF attacks.
4. Exchange Code for Access Token
Exchange the authorization code for an access token by making a POST request:
Authentication Methods (One Required):
The parameters should be sent as
application/x-www-form-urlencoded data.
Example Response:
5. Make API Requests
Use the access token to make authenticated requests to Landing’s API by including it in the Authorization header:6. Refresh Access Token
When an access token expires, use the refresh token to obtain a new one:
Optional Parameters:
Example Response:
User Information
Once authenticated, you can retrieve information about the authenticated user:user.read scope.