Starts the PKCE authorization flow, using [`START_URL`] and [`OIDC_BUILDER_ID_REGION`] as the default issuer URL and region. Returns the [`PkceClient`] to use to finish the flow.
(
start_url: Option<String>,
region: Option<String>,
)
| 63 | /// Starts the PKCE authorization flow, using [`START_URL`] and [`OIDC_BUILDER_ID_REGION`] as the |
| 64 | /// default issuer URL and region. Returns the [`PkceClient`] to use to finish the flow. |
| 65 | pub async fn start_pkce_authorization( |
| 66 | start_url: Option<String>, |
| 67 | region: Option<String>, |
| 68 | ) -> Result<(Client, PkceRegistration), AuthError> { |
| 69 | let issuer_url = start_url.as_deref().unwrap_or(START_URL); |
| 70 | let region = region.clone().map_or(OIDC_BUILDER_ID_REGION, Region::new); |
| 71 | let client = client(region.clone()); |
| 72 | let registration = PkceRegistration::register(&client, region, issuer_url.to_string(), None).await?; |
| 73 | Ok((client, registration)) |
| 74 | } |
| 75 | |
| 76 | /// Represents a client used for registering with AWS IAM OIDC. |
| 77 | #[async_trait::async_trait] |