graph_oauth/identity/credentials/
response_mode.rs

1/// Specifies how the identity platform should return the requested token to your app.
2///
3/// Supported values:
4///
5/// - **query**: Default when requesting an access token. Provides the code as a query string
6///     parameter on your redirect URI. The query parameter is not supported when requesting an
7///     ID token by using the implicit flow.
8/// - fragment: Default when requesting an ID token by using the implicit flow.
9///     Also supported if requesting only a code.
10/// - form_post: Executes a POST containing the code to your redirect URI.
11///     Supported when requesting a code.
12#[derive(Clone, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)]
13pub enum ResponseMode {
14    /// Default when requesting an access token. Provides the code as a query string
15    /// parameter on your redirect URI. The query parameter is not supported when requesting an
16    /// ID token by using the implicit flow.
17    #[default]
18    Query,
19    /// Default when requesting an ID token by using the implicit flow. Also supported if requesting only a code.
20    Fragment,
21    /// Executes a POST containing the code to your redirect URI. Supported when requesting a code.
22    FormPost,
23}
24
25impl AsRef<str> for ResponseMode {
26    fn as_ref(&self) -> &'static str {
27        match self {
28            ResponseMode::Query => "query",
29            ResponseMode::Fragment => "fragment",
30            ResponseMode::FormPost => "form_post",
31        }
32    }
33}