master

laravel/framework

Last updated at: 29/12/2023 09:21

SupportsBasicAuth.php

TLDR

This file defines an interface SupportsBasicAuth in the Illuminate\Contracts\Auth namespace. The interface contains two methods basic and onceBasic for authenticating using HTTP Basic Auth.

Methods

basic

This method is used to attempt authentication using HTTP Basic Auth. It takes two optional parameters field and extraConditions and returns an instance of \Symfony\Component\HttpFoundation\Response or null if the authentication fails.

onceBasic

This method is used to perform a stateless HTTP Basic login attempt. It takes two optional parameters field and extraConditions and returns an instance of \Symfony\Component\HttpFoundation\Response or null if the login attempt fails.

<?php

namespace Illuminate\Contracts\Auth;

interface SupportsBasicAuth
{
    /**
     * Attempt to authenticate using HTTP Basic Auth.
     *
     * @param  string  $field
     * @param  array  $extraConditions
     * @return \Symfony\Component\HttpFoundation\Response|null
     */
    public function basic($field = 'email', $extraConditions = []);

    /**
     * Perform a stateless HTTP Basic login attempt.
     *
     * @param  string  $field
     * @param  array  $extraConditions
     * @return \Symfony\Component\HttpFoundation\Response|null
     */
    public function onceBasic($field = 'email', $extraConditions = []);
}