Install Login With Dropbox On Your Website - OAuth Authentication

File Size: 4.22KB
Views Total: 1058
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Install Login With Dropbox On Your Website - OAuth Authentication

A simple and useful plugin uses OAuth in a jquery plugin to authenticate users on your website using their Dropbox account credentials. It pulls the user details from its Dropbox account and displays the same on your webpage and has logout facility as well.

How to use it:

1. Include the latest jQuery library and dropboxAuth.js on your web page

<script src=""></script>
<script src="dropboxAuth.min.js"></script>

2. Markup HTML Structure

<div id="dropbox-auth-button" class="my-button-style" >&nbsp;&nbsp;&nbsp;&nbsp;loading..</div>

<!-- displaying dropbox user info-->

<div id="auth-info"> <br/>
<b>Id: </b>
<input type="text" id="dropbox-uid" disabled/>
<b>Email: </b>
<input type="text" id="dropbox-email" disabled/>
<b>Name: </b>
<input type="text" id="dropbox-name" disabled/>
<b>Country code: </b>
<input type="text" id="dropbox-countryCode" disabled/>
<b>Total quota: </b>
<input type="text" id="dropbox-quota" disabled/>
<b>Used quota: </b>
<input type="text" id="dropbox-usedQuota" disabled/>
<b>Shared quota: </b>
<input type="text" id="dropbox-sharedBytes" disabled/>

3. The CSS

.my-button-style {
width: 100px;
height: 20px;
margin: 0px auto;
background-image: url('./dropbox_icon.png');
background-repeat: no-repeat;
background-position: left center;
cursor: pointer;
cursor: hand;
border: 1px solid black;
padding: 1px;
line-height: 20px;
#auth-info {
width: 250px;
margin: 0px auto;
text-align: right;

4. Initialize the plugin

<script type="text/javascript">
var dropboxKey = "lSajT1cgXAA=|gElW6fAtZuQ+uMxiSlE18TjbIbZkiVeWxFhEd7zANQ==";


function dropboxLoginSuccess(userInfo) {
//implement your custom code after successful login ----------
//displaying user info here ----------------------------------
$('#dropbox-quota').val((userInfo.quota/1024/1024/1024).toFixed(5) + " GB");
$('#dropbox-usedQuota').val((userInfo.usedQuota/1024/1024/1024).toFixed(5) + " GB");
$('#dropbox-sharedBytes').val((userInfo.sharedBytes/1024/1024/1024).toFixed(5) + " GB");

function dropboxLogoutSuccess() {
//implement your custom code after successful logout ----------

About Author:

Author: Jake


Project Homepage:

This awesome jQuery plugin is developed by unknown. For more Advanced Usages, please check the demo page or visit the official website.