Skip to content

Facebook Signup API

This API provides functionality for users to log in via Facebook OAuth.


Endpoints Overview

Facebook Authentication

Method Endpoint Description
GET /auth/facebook/login/ Redirects users to Facebook login.
GET /auth/facebook/callback/ Handles Facebook OAuth callback.

1. Facebook Login

Endpoint

  • URL: /auth/facebook/login/
  • Method: GET
  • Permission Required: AllowAny

Description

Redirects users to facebook's OAuth login page where they can authenticate their facebook account.

Request Payload

This endpoint does not require a payload.


2. Facebook OAuth Callback

Endpoint

  • URL: /auth/facebook/callback/
  • Method: GET
  • Permission Required: AllowAny

Description

Handles facebook's OAuth callback after successful authentication. The endpoint verifies the OAuth token, retrieves user details, and logs the user into the application.

Query Parameters

  • code - OAuth authorization code provided by Facebook.

Response Examples

Success

{
    "access_token": "eyJhbGciTQIiwidXNlcl9pZCI6MjR9._5jQArLg34O_Xam5QMncqrkeFD7sLw",
    "refresh_token": "eyJhbGciOidGkiOiIxMjdiMWU4MWUxYzVzZXJfaWQiOjI0fQ.UbBWDvest9CEsLaZ6vp",
    "email": "doe.john@gmail.com",
    "first_name": "john",
    "last_name": "doe",
    "created": false
}


Error

{
    "error": "Facebook SocialApp configuration is missing"
}
{
    "error": "Invalid Token"
}