pub struct RegisteredClient { /* private fields */ }Expand description
A client as one authorization server knows it.
The issuer is part of the identity rather than a field a caller must remember
to check, which is the whole point of 2026-07-28 §9. There is no accessor
that returns a ClientSecret for a given issuer, because asking is how the
mistake gets made.
Implementations§
Source§impl RegisteredClient
impl RegisteredClient
Sourcepub fn dynamic(
issuer: impl AsRef<str>,
client_id: ClientId,
secret: Option<ClientSecret>,
) -> Result<Self, ClientIdError>
pub fn dynamic( issuer: impl AsRef<str>, client_id: ClientId, secret: Option<ClientSecret>, ) -> Result<Self, ClientIdError>
A client that obtained its identifier through RFC 7591.
§Errors
ClientIdError::DocumentRegistration if client_id is a metadata
document URL, or ClientIdError::SecretForDocument if a secret is
offered for one. A document-issued client has no secret to present.
Sourcepub fn from_metadata_document(
issuer: impl AsRef<str>,
client_id: ClientId,
) -> Self
pub fn from_metadata_document( issuer: impl AsRef<str>, client_id: ClientId, ) -> Self
A client identified by a Client ID Metadata Document.
Never carries a secret: the draft is explicit that no shared secret can be established for this form, so there is no constructor parameter in which to get it wrong.
Sourcepub const fn with_auth_method(self, method: TokenAuthMethod) -> Self
pub const fn with_auth_method(self, method: TokenAuthMethod) -> Self
This client, authenticating at the token endpoint with method.
For the method the registration response named, or the one a pre-registration was issued with. A secret-based method on a client with no secret is kept as asked; the token endpoint will refuse it, which is a clearer failure than silently going public.
Sourcepub const fn auth_method(&self) -> TokenAuthMethod
pub const fn auth_method(&self) -> TokenAuthMethod
How this client authenticates at the token endpoint.
Sourcepub const fn secret(&self) -> Option<&ClientSecret>
pub const fn secret(&self) -> Option<&ClientSecret>
The secret, if this client has one.
Returns None for a metadata-document client, and Some only when the
caller has already established which issuer it is talking to.
Sourcepub fn is_issued_by(&self, issuer: &str) -> bool
pub fn is_issued_by(&self, issuer: &str) -> bool
Whether this credential was issued by issuer.