internal CredentialConfigurationInfo ToJsonStructure()

in wwauth/Google.Solutions.WWAuth/Data/CredentialConfiguration.cs [130:159]


        internal CredentialConfigurationInfo ToJsonStructure()
        {
            Validate();

            var tokenType = this.Options.Protocol
                == UnattendedCommandLineOptions.AuthenticationProtocol.AdfsOidc
                    ? Data.SubjectTokenType.Jwt
                    : Data.SubjectTokenType.Saml2;

            var userProjectNumber =
                (this.PoolConfiguration as WorkforceIdentityPoolConfiguration)?.UserProjectNumber;

            var serviceAccountImpersonationUrl =
                this.PoolConfiguration is WorkloadIdentityPoolConfiguration &&
                !string.IsNullOrEmpty(this.ServiceAccountEmail)
                    ? "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/" +
                      $"{this.ServiceAccountEmail}:generateAccessToken"
                    : null;

            return new CredentialConfigurationInfo(
                "external_account",
                StsAdapter.DefaultTokenUrl,
                this.PoolConfiguration.Audience,
                userProjectNumber,
                serviceAccountImpersonationUrl,
                tokenType.GetDescription(),
                new CredentialSourceInfo(new ExecutableInfo(
                    this.Options.ToString(),
                    (ulong)this.Timeout.TotalMilliseconds)));
        }