Function tokio_ddmw::auth::authenticate[][src]

pub async fn authenticate<T: AsyncRead + AsyncWrite + Unpin>(
    conn: &mut Framed<T, Codec>,
    ai: &AuthInfo
) -> Result<Option<String>, Error>

Helper function for authenticating a connection.

  1. Attempt to authenticate using token, if one was supplied (either by buffer or filename).
  2. If token authentication failed, and account name and passphrase was supplied, then attempt to authenticate with the account name and passphrase.
  3. If an output token file name was supplied, then save the returned authentication to that file.