pub struct SwaggerOAuth2Config {
pub issuer: String,
pub client_id: String,
pub scopes: Vec<String>,
pub pkce: bool,
}Expand description
OIDC single-sign-on for the Swagger UI ([swagger.oauth2]).
Configures the UI to drive an Authorization Code + PKCE flow against
the given OIDC issuer. Swagger UI auto-discovers the authorize /
token endpoints from <issuer>/.well-known/openid-configuration,
so we don’t need to pin them here.
All fields are required when the block is present — there is no
sensible default for issuer or client_id.
Fields§
§issuer: StringOIDC issuer URL, e.g.
https://login.microsoftonline.com/<tenant>/v2.0 or
https://accounts.google.com. Must not end in /.
client_id: StringPublic OAuth2 client identifier registered with the IdP. The
client must be a SPA / public client (no secret) with
https://<your-host>{swagger.path}/oauth2-redirect.html listed
as an allowed redirect URI.
scopes: Vec<String>Scopes to request by default. Will be pre-checked in the Swagger
UI authorize dialog; users can edit them before signing in.
openid is always added if missing.
pkce: boolUse PKCE for the authorization code flow. Defaults to true;
disable only if your IdP doesn’t support PKCE for public clients.
Trait Implementations§
Source§impl Clone for SwaggerOAuth2Config
impl Clone for SwaggerOAuth2Config
Source§fn clone(&self) -> SwaggerOAuth2Config
fn clone(&self) -> SwaggerOAuth2Config
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more