Reference documentation and code samples for the Google API Common Protos Client class OAuthRequirements.
OAuth scopes are a way to define data and permissions on data. For example,
there are scopes defined for "Read-only access to Google Calendar" and
"Access to Cloud Platform". Users can consent to a scope for an application,
giving it permission to access that data on their behalf.
OAuth scope specifications should be fairly coarse grained; a user will need
to see and understand the text description of what your scope means.
In most cases: use one or at most two OAuth scopes for an entire family of
products. If your product has multiple APIs, you should probably be sharing
the OAuth scope across all of those APIs.
When you need finer grained OAuth consent screens: talk with your product
management about how developers will use them in practice.
Please note that even though each of the canonical scopes is enough for a
request to be accepted and passed to the backend, a request can still fail
due to the backend requiring additional scopes or permissions.
Generated from protobuf messagegoogle.api.OAuthRequirements
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google API Common Protos Client - Class OAuthRequirements (4.12.3)\n\nVersion latestkeyboard_arrow_down\n\n- [4.12.3 (latest)](/php/docs/reference/common-protos/latest/Api.OAuthRequirements)\n- [4.12.2](/php/docs/reference/common-protos/4.12.2/Api.OAuthRequirements)\n- [4.11.0](/php/docs/reference/common-protos/4.11.0/Api.OAuthRequirements)\n- [4.10.0](/php/docs/reference/common-protos/4.10.0/Api.OAuthRequirements)\n- [4.9.0](/php/docs/reference/common-protos/4.9.0/Api.OAuthRequirements)\n- [4.8.3](/php/docs/reference/common-protos/4.8.3/Api.OAuthRequirements) \nReference documentation and code samples for the Google API Common Protos Client class OAuthRequirements.\n\nOAuth scopes are a way to define data and permissions on data. For example,\nthere are scopes defined for \"Read-only access to Google Calendar\" and\n\"Access to Cloud Platform\". Users can consent to a scope for an application,\ngiving it permission to access that data on their behalf.\n\nOAuth scope specifications should be fairly coarse grained; a user will need\nto see and understand the text description of what your scope means.\nIn most cases: use one or at most two OAuth scopes for an entire family of\nproducts. If your product has multiple APIs, you should probably be sharing\nthe OAuth scope across all of those APIs.\nWhen you need finer grained OAuth consent screens: talk with your product\nmanagement about how developers will use them in practice.\nPlease note that even though each of the canonical scopes is enough for a\nrequest to be accepted and passed to the backend, a request can still fail\ndue to the backend requiring additional scopes or permissions.\n\nGenerated from protobuf message `google.api.OAuthRequirements`\n\nNamespace\n---------\n\nGoogle \\\\ Api\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getCanonicalScopes\n\nThe list of publicly documented OAuth scopes that are allowed access. An\nOAuth token containing any of these scopes will be accepted.\n\nExample:\ncanonical_scopes: \u003chttps://www.googleapis.com/auth/calendar\u003e,\n\u003chttps://www.googleapis.com/auth/calendar.read\u003e\n\n### setCanonicalScopes\n\nThe list of publicly documented OAuth scopes that are allowed access. An\nOAuth token containing any of these scopes will be accepted.\n\nExample:\ncanonical_scopes: \u003chttps://www.googleapis.com/auth/calendar\u003e,\n\u003chttps://www.googleapis.com/auth/calendar.read\u003e"]]