Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Deprecation warnings when using Application Default Credentials #2151

@ryanolf

Description

@ryanolf

Please make sure you have searched for information in the following guides.

A screenshot that you have tested with "Try this API".

I've setup a clean install of PubSub that listens for messages using the exact pattern in the listenForMessages sample. My credentials were downloaded as json for service account. It all works but I see these warnings:

The `fromStream` method is deprecated. Please use the `JWT` constructor with a parsed stream instead. For more details, see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.
The `fromJSON` method is deprecated. Please use the `JWT` constructor instead. For more details, see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.
The `fromStream` method is deprecated. Please use the `JWT` constructor with a parsed stream instead. For more details, see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.
The `fromJSON` method is deprecated. Please use the `JWT` constructor instead. For more details, see https://cl

I'm not configuring the authentication manually at all -- seems like the default behaviour under the hood should be updated to use the JWT constructor.

Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.

https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listenForMessages.js

A step-by-step description of how to reproduce the issue, based on the linked reproduction.

  1. Run node listenForMessages.js SUBSCRIPTION_NAME_OR_ID with application default credentials pointing to json credential file.

A clear and concise description of what the bug is, and what you expected to happen.

The library should not use deprecated methods by default.

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

Seems reasonable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: pubsubIssues related to the Pub/Sub API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions