public static function factory(array $oaResponse) {

		if(empty($oaResponse['auth'])) {
			throw new InvalidArgumentException('The auth key is required to continue.');
		}
		if(empty($oaResponse['auth']['provider'])) {
			throw new InvalidArgumentException('Unable to determine provider.');
		}

		$auth = $oaResponse['auth'];

		$do = OpauthIdentity::get()->filter(
			array(
				'Provider' => $auth['provider'],
				'UID' => $auth['uid'],
			)
		)->first();

		if(!$do || !$do->exists()) {
			$do = new OpauthIdentity();
			$do->Provider = $auth['provider'];
			$do->UID = $auth['uid'];
		}

		$do->setAuthSource($auth);
		return $do;
	}