pub struct LoginForm {
pub grant_type: String,
pub username: Option<String>,
pub password: Option<String>,
pub client_id: Option<String>,
pub client_secret: Option<String>,
pub scope: Option<String>,
}Expand description
Represents the payload used for authentication requests following the OAuth2-style “password” or “client credentials” grant patterns.
This structure is typically deserialized from an HTTP request body
with application/x-www-form-urlencoded or JSON content, depending
on the server configuration.
Field names are serialized/deserialized using kebab-case to match common OAuth2 conventions.
§Fields
-
grant_typeThe authorization grant type that defines how the access token should be issued (e.g.,"password","client-credentials"). -
usernameThe resource owner’s username. Required when using the"password"grant type. -
passwordThe resource owner’s password. Required when using the"password"grant type. -
client_idThe client application identifier issued during client registration. Required for client authentication. -
client_secretThe client application secret. Required for confidential clients when authenticating with the authorization server. -
scopeA space-delimited list of requested permission scopes that define the level of access being requested.
§Serialization
This struct derives Serialize and Deserialize and uses
#[serde(rename_all = "kebab-case")], meaning a field like
client_id becomes client-id in the serialized representation.
§Example JSON
{
"grant-type": "password",
"username": "user@example.com",
"password": "secret",
"client-id": "my-client",
"client-secret": "super-secret",
"scope": "read write"
}Fields§
§grant_type: String§username: Option<String>§password: Option<String>§client_id: Option<String>§client_secret: Option<String>§scope: Option<String>Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LoginForm
impl<'de> Deserialize<'de> for LoginForm
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for LoginForm
impl RefUnwindSafe for LoginForm
impl Send for LoginForm
impl Sync for LoginForm
impl Unpin for LoginForm
impl UnsafeUnpin for LoginForm
impl UnwindSafe for LoginForm
Blanket Implementations§
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
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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request