#[non_exhaustive]pub struct NativeConfig {
pub issuer: Url,
pub client_id: String,
pub resource: Option<String>,
}Expand description
Boot configuration for a NativeAuthFlow.
Deliberately carries no redirect URI: a loopback client binds an
ephemeral port at run time (RFC 8252 §7.3 requires the server to accept
any port on 127.0.0.1 / [::1]), so the redirect is not knowable when
the flow is constructed. It is supplied per attempt, to
NativeAuthFlow::start.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.issuer: UrlThe authorization server’s issuer URL; discovery hangs off it.
client_id: StringThe registered public-client identifier. No client secret — a native app cannot keep one (RFC 8252 §8.5), which is why PKCE is mandatory.
resource: Option<String>RFC 8707 resource indicator, verbatim. See
Self::with_resource.
Implementations§
Source§impl NativeConfig
impl NativeConfig
Sourcepub fn new(issuer: Url, client_id: impl Into<String>) -> Self
pub fn new(issuer: Url, client_id: impl Into<String>) -> Self
A config for client_id against the authorization server at
issuer.
Sourcepub fn with_resource(self, resource: impl Into<String>) -> Self
pub fn with_resource(self, resource: impl Into<String>) -> Self
Bind the token to a specific resource server (RFC 8707), so the
minted aud clears that server’s perimeter instead of defaulting to
the client id.
Pass the value exactly as registered. It is matched
byte-for-byte and never parsed, because parsing is what breaks it:
round-tripping a host-only URI through Url appends a trailing
slash (http://localhost:3200 → http://localhost:3200/), and PAS
rejects the slashed form outright with invalid_target — verified
live, 2026-07-21.
Trait Implementations§
Source§impl Clone for NativeConfig
impl Clone for NativeConfig
Source§fn clone(&self) -> NativeConfig
fn clone(&self) -> NativeConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more