pub struct ClientId(/* private fields */);Expand description
A client’s identifier at its authorization server.
Two forms, and they are not interchangeable. RFC 7591 hands out an opaque
string; a Client ID Metadata Document uses the URL the document is served
from. verify_metadata_document checks
the second form’s defining property.
Implementations§
Source§impl ClientId
impl ClientId
Sourcepub fn opaque(value: impl AsRef<str>) -> Self
pub fn opaque(value: impl AsRef<str>) -> Self
An opaque identifier, as RFC 7591’s client_id response member is.
Sourcepub fn metadata_url(value: impl AsRef<str>) -> Result<Self, ClientIdError>
pub fn metadata_url(value: impl AsRef<str>) -> Result<Self, ClientIdError>
The client_id of a Client ID Metadata Document.
§Errors
ClientIdError::NotHttps if the URL is not https. The draft
requires an HTTPS URL, and a client_id that is not one is a
configuration mistake worth naming rather than a value to discover at
the authorization server.
Sourcepub fn verify_metadata_document(
&self,
document_client_id: &str,
) -> Result<(), ClientIdError>
pub fn verify_metadata_document( &self, document_client_id: &str, ) -> Result<(), ClientIdError>
Check that a metadata document vouches for this client_id.
The draft requires the document’s client_id property to “match the URL
of the document using simple string comparison as defined in RFC 3986
Section 6.2.1” — the same discipline
check_response_issuer
applies to RFC 9207’s iss, and for the same reason. Normalising here
would let a document served at one URL claim the identity of another.
§Errors
ClientIdError::DocumentMismatch when the document’s client_id is
not this URL by simple string comparison.