Struct actix_web_httpauth::headers::authorization::Authorization
[−]
[src]
pub struct Authorization<S: Scheme>(_);
Authorization
header, defined in RFC 7235
The "Authorization" header field allows a user agent to authenticate itself with an origin server -- usually, but not necessarily, after receiving a 401 (Unauthorized) response. Its value consists of credentials containing the authentication information of the user agent for the realm of the resource being requested.
Authorization
header is generic over authentication scheme.
Example
use actix_web::{HttpRequest, Result}; use actix_web::http::header::Header; use actix_web_httpauth::headers::authorization::{Authorization, Basic}; fn handler(req: HttpRequest) -> Result<String> { let auth = Authorization::<Basic>::parse(&req)?; Ok(format!("Hello, {}!", auth.username)) }
Methods
impl<S: Scheme> Authorization<S>
[src]
pub fn into_inner(self) -> S
[src]
Trait Implementations
impl<S: Scheme> Header for Authorization<S>
[src]
fn name() -> HeaderName
[src]
Returns the name of the header field
fn parse<T: HttpMessage>(msg: &T) -> Result<Self, ParseError>
[src]
Parse a header
impl<S: Scheme> IntoHeaderValue for Authorization<S>
[src]
type Error = <S as IntoHeaderValue>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<HeaderValue, Self::Error>
[src]
Cast from PyObject to a concrete Python object type.
impl<S: Scheme> Display for Authorization<S>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<S: Scheme> Deref for Authorization<S>
[src]
type Target = S
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
Dereferences the value.