openid_client/types/
userinfo_options.rs

1use std::collections::HashMap;
2
3use josekit::jwk::Jwk;
4
5/// # UserinfoRequestParams
6/// Parameters for customizing Userinfo request
7pub struct UserinfoOptions<'a> {
8    /// Request method: POST or GET
9    pub method: &'a str,
10    /// How to send the access token. Valid values: `header` or `body` (POST request)
11    pub via: &'a str,
12    /// Additional params to sent with the userinfo request
13    pub params: Option<HashMap<String, String>>,
14    /// When provided the client will send a DPoP Proof JWT.
15    pub dpop: Option<&'a Jwk>,
16}
17
18impl Default for UserinfoOptions<'_> {
19    fn default() -> Self {
20        Self {
21            method: "GET",
22            via: "header",
23            params: None,
24            dpop: None,
25        }
26    }
27}