Struggling to get signing_input (JWT) token from the output of openIdConnect crate

I am using open for Google Oauth2.

  let token_response =
        // Set the PKCE code verifier.
        .unwrap_or_else(|err| {
            handle_error(&err, "Failed to contact token endpoint");

        "Google returned access token:\n{}\n",

    println!("Google returned scopes: {:?}", token_response.scopes());
    println!("Google returned id token: {:?}", token_response.id_token().unwrap());

the last line prints everything including the signing_input like this but i don't know how to extract signing_input from token_response. Please help

IdToken(JsonWebToken { header: JsonWebTokenHeader { alg: Signature(RsaSsaPkcs1V15Sha256, PhantomData<openidconnect::core::jwk::CoreJsonWebKeyType>), crit: None, cty: None, kid: Some(JsonWebKeyId("REDACTED")), typ: Some(JsonWebTokenType("JWT")), _phantom_jt: PhantomData<openidconnect::core::jwk::CoreJsonWebKeyType> }, payload: IdTokenClaims { issuer: IssuerUrl(""), audiences: [Audience("REDACTED")], expiration: 2024-02-11T12:22:47Z, issue_time: 2024-02-11T11:22:47Z, auth_time: None, nonce: Some(Nonce([redacted])), auth_context_ref: None, auth_method_refs: None, authorized_party: Some(ClientId("8REDACTED")), access_token_hash: Some(AccessTokenHash("REDACTED")), code_hash: None, standard_claims: StandardClaims { sub: SubjectIdentifier("REDACTED"), name: Some(LocalizedClaim({}, Some(EndUserName("REDACTED")))), given_name: Some(LocalizedClaim({}, Some(EndUserGivenName("REDACTED")))), family_name: Some(LocalizedClaim({}, Some(EndUserFamilyName("REDACTED")))), middle_name: None, nickname: None, preferred_username: None, profile: None, picture: Some(LocalizedClaim({}, Some(EndUserPictureUrl("REDACTED")))), website: None, email: Some(EndUserEmail("REDACTED")), email_verified: Some(true), gender: None, birthday: None, birthdate: None, zoneinfo: None, locale: Some(LanguageTag("en-GB")), phone_number: None, phone_number_verified: None, address: None, updated_at: None }, additional_claims: EmptyAdditionalClaims }, signature: [REDACTED], signing_input: "<REDACTED>", _phantom: PhantomData<openidconnect::jwt::JsonWebTokenJsonPayloadSerde> })

I don't see a way you can access JsonWebToken::signing_input, as the type is private and the field not otherwise exposed by the API as far as I can tell from staring at the docs. I think you have to ask the maintainers to add the ability to access the field in a future release of the crate.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.