pub struct OAuthConfig { /* private fields */ }Expand description
What the flow is told about this client and this server.
Implementations§
Source§impl OAuthConfig
impl OAuthConfig
Sourcepub fn new(server: &str, version: ProtocolVersion) -> Result<Self, ParseError>
pub fn new(server: &str, version: ProtocolVersion) -> Result<Self, ParseError>
A client of the MCP server at server, speaking version.
§Errors
url::ParseError when server is not a URL.
Sourcepub fn redirect_to(self, redirect_uri: impl Into<String>) -> Self
pub fn redirect_to(self, redirect_uri: impl Into<String>) -> Self
Where the authorization server sends the user back to.
Sourcepub fn named(self, client_name: impl Into<String>) -> Self
pub fn named(self, client_name: impl Into<String>) -> Self
The name shown to the user at consent, and sent when registering.
Sourcepub fn with_metadata_document(self, url: impl Into<String>) -> Self
pub fn with_metadata_document(self, url: impl Into<String>) -> Self
The HTTPS URL of this client’s metadata document, used as its
client_id with servers that support such ids.
Sourcepub fn with_pre_registered(self, credentials: PreRegistered) -> Self
pub fn with_pre_registered(self, credentials: PreRegistered) -> Self
Credentials issued to this client by the authorization server.
Sourcepub const fn wanting_refresh_tokens(self) -> Self
pub const fn wanting_refresh_tokens(self) -> Self
Asks for a refresh token where the server offers one.
Adds offline_access to the scope only when the server lists it, and
refresh_token to the grant types this client registers with.
Trait Implementations§
Source§impl Clone for OAuthConfig
impl Clone for OAuthConfig
Auto Trait Implementations§
impl Freeze for OAuthConfig
impl RefUnwindSafe for OAuthConfig
impl Send for OAuthConfig
impl Sync for OAuthConfig
impl Unpin for OAuthConfig
impl UnsafeUnpin for OAuthConfig
impl UnwindSafe for OAuthConfig
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
Mutably borrows from an owned value. Read more