Skip to content

Instantly share code, notes, and snippets.

View phuze's full-sized avatar

Brendon phuze

View GitHub Profile
@phuze
phuze / dropbox-php-auth.md
Last active October 22, 2024 22:45
Dropbox API V2: PHP Authentication Process

Effective September 2021, Dropbox will be deprecating long-lived access tokens.

This GIST generally describes how to authenticate requests to Dropbox API v2, for anyone working on a server-side PHP Dropbox implementation.

It's important to understand three types of codes you'll encounter:

  1. Access Code - this is a one-time code that represents user-granted app access.
  2. Access Token - this is short-lived token that provides access to Dropbox API endpoints.
  3. Refresh Token - this is a long-lived token that allows you to fetch a fresh Access Token.
@phuze
phuze / users.pl
Last active February 21, 2022 21:08
Perl script for managing users in a Berkeley DB within a Linux environment. Read the full article: Building a Secure FTP Server — https://phuze.dev/building-a-secure-ftp-server
#!/usr/bin/perl -w
#
# USAGE
# =====
# Run this script from within linux.
# Note: you must include the leading dot.
#
# ./path/to/users usage
@phuze
phuze / FtpModel.php
Last active February 21, 2022 03:22
PHP model for interfacing with remote user management script. The remote script manages users in a Berkeley DB within a Linux environment. Read the full article: Building a Secure FTP Server — https://phuze.dev/building-a-secure-ftp-server
<?php
namespace MyApi\Models;
use phpseclib3\Net\SSH2;
use phpseclib3\Crypt\PublicKeyLoader;
/**
* FTP model
*/