<?php

namespace AuthStack\SP\Helpers;


use AuthStack\SP\ServiceProvider;
use Symfony\Component\HttpFoundation\Request;

class AuthN
{
    public function __construct(array $config, $idp, Request $request = null)
    {
        $this->sp = new ServiceProvider($config, $idp);
        $this->request = $request;
    }

    public function consume()
    {
        return $this->sp->consume($this->request);
    }

    public function create()
    {
        return $this->sp->authn();
    }
}