pub struct AuthorizationRequest {
pub client_id: String,
pub redirect_uri: String,
pub scope: String,
pub state: String,
pub response_type: String,
pub code_challenge: Option<String>,
pub code_challenge_method: Option<String>,
}Expand description
OAuth2 授权请求参数
Fields§
§client_id: String客户端 ID
redirect_uri: String重定向 URI
scope: String请求的权限范围(空格分隔)
state: StringCSRF 防护状态值
response_type: String响应类型(固定为 “code”)
code_challenge: Option<String>PKCE code_challenge(RFC 7636,v4.8.0 修复 M-7)
携带 challenge 的授权码在交换令牌时强制要求匹配的 code_verifier, 抵御授权码拦截攻击(即使授权码泄露也无法兑换令牌)。
code_challenge_method: Option<String>PKCE 方法(当前仅支持 “S256”)
Implementations§
Trait Implementations§
Source§impl Clone for AuthorizationRequest
impl Clone for AuthorizationRequest
Source§fn clone(&self) -> AuthorizationRequest
fn clone(&self) -> AuthorizationRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AuthorizationRequest
impl RefUnwindSafe for AuthorizationRequest
impl Send for AuthorizationRequest
impl Sync for AuthorizationRequest
impl Unpin for AuthorizationRequest
impl UnsafeUnpin for AuthorizationRequest
impl UnwindSafe for AuthorizationRequest
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