<?php

namespace AuthStack\SP;


//use function Buckhill\config;
use AuthStack\SP\Requests\AuthN;
use Symfony\Component\HttpFoundation\Request;

/**
 * Class ACS
 * @package AuthStack\SP
 */
class ServiceProvider extends AbstractSP
{
    public function consume(Request $request = null)
    {
        $response = $this->checkRequest($request);

        $assertion = $this->getAssertions($response);

        return AttributeCollection::fromAssertion($assertion);
    }


    /**
     * @return AuthN
     */
    public function authn()
    {
        return new AuthN($this->idp);
    }
}
