OAuth Lab - liamb8/sec440 GitHub Wiki

OAuth Lab

Setup Oauth App

Go to Settings -> Developer Settings -> Oauth Apps -> New App

Input an Application name

Set the Homepage URL to https://127.0.0.1:5000

Set the Authorization callback URL to https://127.0.0.1:5000/callback

Save the Client ID and Client Secret after generating it

Set up to run on xubuntu-lan

Clone the Git Repository

git clone (repo link)

Create creds.json in the source directory

{
    "client_id":"champlain",
    "client_secret":"chauncey",
    "authorization_base_url":"https://github.com/login/oauth/authorize",
    "token_url":"https://github.com/login/oauth/access_token"
}

Replace champlain with the client id from the oauth app and chauncey with the client secret generated

Next install these packages

apt install python3-pip build-essential libffi-dev python3-dev python3-setuptools libssl-dev
apt install python3.8-venv
pip3 install virtualenvwrapper
python3 -m venv venv
source venv/bin/activate

pip3 install wheel
pip3 install -r requirements.txt

Run the code once done

python3 app.py

Set up on AWS

Follow the same steps above by generating a new oauth app a new client secret key

Set the homepage URL and callback URL to the dns of the AWS instance

After this repeat the steps above