Skip to content

Instantly share code, notes, and snippets.

@aaronpk
aaronpk / indieauth-client.php
Created September 9, 2012 16:44
Simple PHP example of using the indieauth.com API
<?php
session_start();
if(array_key_exists('token', $_GET)) {
// Verify the token with indieauth.com
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://indieauth.com/session?token=' . $_GET['token']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$auth = json_decode(curl_exec($ch));
// If we got a reply, store the domain in the session