pub struct KerberosManager { /* private fields */ }Expand description
Kerberos / SPNEGO authentication manager.
Implementations§
Source§impl KerberosManager
impl KerberosManager
Sourcepub fn new(config: KerberosConfig) -> Result<Self>
pub fn new(config: KerberosConfig) -> Result<Self>
Create a new Kerberos manager.
Sourcepub async fn load_keytab(&self, path: &str) -> Result<usize>
pub async fn load_keytab(&self, path: &str) -> Result<usize>
Load keytab entries from file.
Sourcepub async fn authenticate(
&self,
negotiate_token: &str,
) -> Result<KerberosAuthResult>
pub async fn authenticate( &self, negotiate_token: &str, ) -> Result<KerberosAuthResult>
Process an HTTP Authorization: Negotiate <token> header.
Returns the authentication result on success, or an appropriate error.
The caller should return the response_token (if any) in a
WWW-Authenticate: Negotiate <token> response header.
Sourcepub fn generate_challenge(&self) -> String
pub fn generate_challenge(&self) -> String
Generate a WWW-Authenticate: Negotiate challenge header value.
Sourcepub async fn check_replay(&self, token_data: &[u8]) -> Result<()>
pub async fn check_replay(&self, token_data: &[u8]) -> Result<()>
Check for replay attacks using a raw token hash (for backwards compat).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KerberosManager
impl !RefUnwindSafe for KerberosManager
impl Send for KerberosManager
impl Sync for KerberosManager
impl Unpin for KerberosManager
impl UnsafeUnpin for KerberosManager
impl !UnwindSafe for KerberosManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more