Skip to main content

DRF AccountKit is the wrapper to use facebook account kit to authenticate first time in Django REST Framework

Project description

# drf-accountkit
This package enables the use of Facebook Accountkit for Django Rest Framework

If you want to know more about Facebook Accountkit, check out the following resources

## Installation & Configuration

pip install drf-accountkit

Then to add the Django Accountkit to your project add the app `drf_accountkit` to your `INSTALLED_APPS`

And add `drf_accountkit` URLconf to your `` like this:

path('[YOUR_PREFIX]/', include('drf_accountkit.urls')),

Now add the following settings in your file

FACEBOOK_APP_ID = <Accountkit App ID>
ACCOUNT_KIT_APP_SECRET = <Accountkit App Secret>

## Usage

You have to configure account kit in your frontend and specify `[YOUR_PREFIX]/login_success` as the success url.

You either send to login success as POST (or GET) those info:
- `access_token`


- `code`, `state`, `status`

You will get as result:
- **Successful:** API status 200 or 201
- `token`
- `user_id`
- **Refusal:** API status 401
- `message`

## Costumization
You can overide methods of `LoginSuccess` API view like:
- `get_username(phone, email)` to costumize the username to be stored
- `response(user, token)` to costumize the response of endpoint

### This is project is based on

- The django implementation of accountkit at

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for drf-accountkit, version 0.2.3
Filename, size File type Python version Upload date Hashes
Filename, size drf-accountkit-0.2.3.tar.gz (4.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page