pub async fn discovery(ctx: &mut Context) -> HandlerResult {
    let mut res = json_response(&json!({
        "issuer": ctx.app.public_url,
        "authorization_endpoint": format!("{}/auth", ctx.app.public_url),
        "token_endpoint": format!("{}/token", ctx.app.public_url),
        "token_endpoint_auth_methods_supported": ["client_secret_basic"],
        "jwks_uri": format!("{}/keys.json", ctx.app.public_url),
        "scopes_supported": vec!["openid", "email"],
        "claims_supported": vec!["iss", "aud", "exp", "iat", "email"],
        "response_types_supported": vec!["id_token", "code"],
        "response_modes_supported": vec!["form_post", "fragment", "query"],
        "grant_types_supported": vec!["implicit", "authorization_code"],
        "subject_types_supported": vec!["public"],
        "id_token_signing_alg_values_supported": &ctx.app.signing_algs,
        // NOTE: This field is non-standard.
        "accepts_id_token_signing_alg_query_param": true,
    }));
    res.typed_header(
        CacheControl::new()
            .with_public()
            .with_max_age(ctx.app.discovery_ttl)
            .with_s_max_age(Duration::from_secs(0)),
    );
    Ok(res)
}
/// Request handler to return the OpenID Discovery document.
///
/// Most of this is hard-coded for now, although the URLs are constructed by
/// using the base URL as configured in the `public_url` configuration value.
Request handler to return the OpenID Discovery document.
Most of this is hard-coded for now, although the URLs are constructed by
using the base URL as configured in the `public_url` configuration value.
Request handler to return the OpenID Discovery document . Most of this is hard - coded for now although the URLs are constructed by using the base URL as configured in the ` public_url ` configuration value .
pub async fn discovery(ctx: &mut Context) -> HandlerResult {
    let mut res = json_response(&json!({
        "issuer": ctx.app.public_url,
        "authorization_endpoint": format!("{}/auth", ctx.app.public_url),
        "token_endpoint": format!("{}/token", ctx.app.public_url),
        "token_endpoint_auth_methods_supported": ["client_secret_basic"],
        "jwks_uri": format!("{}/keys.json", ctx.app.public_url),
        "scopes_supported": vec!["openid", "email"],
        "claims_supported": vec!["iss", "aud", "exp", "iat", "email"],
        "response_types_supported": vec!["id_token", "code"],
        "response_modes_supported": vec!["form_post", "fragment", "query"],
        "grant_types_supported": vec!["implicit", "authorization_code"],
        "subject_types_supported": vec!["public"],
        "id_token_signing_alg_values_supported": &ctx.app.signing_algs,
        // NOTE: This field is non-standard.
        "accepts_id_token_signing_alg_query_param": true,
    }));
    res.typed_header(
        CacheControl::new()
            .with_public()
            .with_max_age(ctx.app.discovery_ttl)
            .with_s_max_age(Duration::from_secs(0)),
    );
    Ok(res)
}
pub async fn discovery ( ctx : & mut Context ) -> HandlerResult { let mut res = json_response ( & json ! ( { " " ctx app public_url " " format ( " " ctx app public_url ) " " format ( " " ctx app public_url ) " " [ " " ] " " format ( " " ctx app public_url ) " " vec [ " " " " ] " " vec [ " " " " " " " " " " ] " " vec [ " " " " ] " " vec [ " " " " " " ] " " vec [ " " " " ] " " vec [ " " ] " " ctx app signing_algs // NOTE: This field is non-standard. " " true } ) ) ; res . typed_header ( CacheControl :: new ( ) . with_public ( ) . with_max_age ( ctx . app . discovery_ttl ) . with_s_max_age ( Duration :: from_secs ( 0 ) ) , ) ; Ok ( res ) }
Request handler to return the OpenID Discovery document.
Request handler to return the OpenID Discovery document .
ctx
&mut Context
ctx
&mut Context