Show / Hide Table of Contents

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.

Inheritance
System.Object
OAuthRequirements
Implements
IMessage<OAuthRequirements>
IMessage
System.IEquatable<OAuthRequirements>
IDeepCloneable<OAuthRequirements>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Api
Assembly: Google.Api.CommonProtos.dll
Syntax
public sealed class OAuthRequirements : IMessage<OAuthRequirements>, IMessage, IEquatable<OAuthRequirements>, IDeepCloneable<OAuthRequirements>

Constructors

OAuthRequirements()

Declaration
public OAuthRequirements()

OAuthRequirements(OAuthRequirements)

Declaration
public OAuthRequirements(OAuthRequirements other)
Parameters
Type Name Description
OAuthRequirements other

Fields

CanonicalScopesFieldNumber

Field number for the "canonical_scopes" field.

Declaration
public const int CanonicalScopesFieldNumber = 1
Field Value
Type Description
System.Int32

Properties

CanonicalScopes

The list of publicly documented OAuth scopes that are allowed access. An OAuth token containing any of these scopes will be accepted.

Example:

canonical_scopes: https://www.googleapis.com/auth/calendar, https://www.googleapis.com/auth/calendar.read

Declaration
public string CanonicalScopes { get; set; }
Property Value
Type Description
System.String

Descriptor

Declaration
public static MessageDescriptor Descriptor { get; }
Property Value
Type Description
MessageDescriptor

Parser

Declaration
public static MessageParser<OAuthRequirements> Parser { get; }
Property Value
Type Description
MessageParser<OAuthRequirements>

Methods

CalculateSize()

Declaration
public int CalculateSize()
Returns
Type Description
System.Int32
Implements
IMessage.CalculateSize()

Clone()

Declaration
public OAuthRequirements Clone()
Returns
Type Description
OAuthRequirements
Implements
IDeepCloneable<T>.Clone()

Equals(OAuthRequirements)

Declaration
public bool Equals(OAuthRequirements other)
Parameters
Type Name Description
OAuthRequirements other
Returns
Type Description
System.Boolean
Implements
System.IEquatable<T>.Equals(T)

Equals(Object)

Declaration
public override bool Equals(object other)
Parameters
Type Name Description
System.Object other
Returns
Type Description
System.Boolean
Overrides
System.Object.Equals(System.Object)

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.Object.GetHashCode()

MergeFrom(OAuthRequirements)

Declaration
public void MergeFrom(OAuthRequirements other)
Parameters
Type Name Description
OAuthRequirements other
Implements
IMessage<T>.MergeFrom(T)

MergeFrom(CodedInputStream)

Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Type Name Description
CodedInputStream input
Implements
IMessage.MergeFrom(CodedInputStream)

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

WriteTo(CodedOutputStream)

Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Type Name Description
CodedOutputStream output
Implements
IMessage.WriteTo(CodedOutputStream)

Explicit Interface Implementations

IMessage.Descriptor

Declaration
MessageDescriptor IMessage.Descriptor { get; }
Returns
Type Description
MessageDescriptor
Implements
IMessage.Descriptor
Back to top