Class AuthRequirement.Builder (2.65.0)

public static final class AuthRequirement.Builder extends GeneratedMessage.Builder<AuthRequirement.Builder> implements AuthRequirementOrBuilder

User-defined authentication requirements, including support for JSON Web Token (JWT).

Protobuf type google.api.AuthRequirement

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

build()

public AuthRequirement build()
Returns
Type Description
AuthRequirement

buildPartial()

public AuthRequirement buildPartial()
Returns
Type Description
AuthRequirement

clear()

public AuthRequirement.Builder clear()
Returns
Type Description
AuthRequirement.Builder
Overrides

clearAudiences()

public AuthRequirement.Builder clearAudiences()

NOTE: This will be deprecated soon, once AuthProvider.audiences is implemented and accepted in all the runtime components.

The list of JWT audiences. that are allowed to access. A JWT containing any of these audiences will be accepted. When this setting is absent, only JWTs with audience "https://Service_name/API_name" will be accepted. For example, if no audiences are in the setting, LibraryService API will only accept JWTs with the following audience "https://library-example.googleapis.com/google.example.library.v1.LibraryService".

Example:

audiences: bookstore_android.apps.googleusercontent.com, bookstore_web.apps.googleusercontent.com

string audiences = 2;

Returns
Type Description
AuthRequirement.Builder

This builder for chaining.

clearProviderId()

public AuthRequirement.Builder clearProviderId()

id from authentication provider.

Example:

provider_id: bookstore_auth

string provider_id = 1;

Returns
Type Description
AuthRequirement.Builder

This builder for chaining.

getAudiences()

public String getAudiences()

NOTE: This will be deprecated soon, once AuthProvider.audiences is implemented and accepted in all the runtime components.

The list of JWT audiences. that are allowed to access. A JWT containing any of these audiences will be accepted. When this setting is absent, only JWTs with audience "https://Service_name/API_name" will be accepted. For example, if no audiences are in the setting, LibraryService API will only accept JWTs with the following audience "https://library-example.googleapis.com/google.example.library.v1.LibraryService".

Example:

audiences: bookstore_android.apps.googleusercontent.com, bookstore_web.apps.googleusercontent.com

string audiences = 2;

Returns
Type Description
String

The audiences.

getAudiencesBytes()

public ByteString getAudiencesBytes()

NOTE: This will be deprecated soon, once AuthProvider.audiences is implemented and accepted in all the runtime components.

The list of JWT audiences. that are allowed to access. A JWT containing any of these audiences will be accepted. When this setting is absent, only JWTs with audience "https://Service_name/API_name" will be accepted. For example, if no audiences are in the setting, LibraryService API will only accept JWTs with the following audience "https://library-example.googleapis.com/google.example.library.v1.LibraryService".

Example:

audiences: bookstore_android.apps.googleusercontent.com, bookstore_web.apps.googleusercontent.com

string audiences = 2;

Returns
Type Description
ByteString

The bytes for audiences.

getDefaultInstanceForType()

public AuthRequirement getDefaultInstanceForType()
Returns
Type Description
AuthRequirement

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getProviderId()

public String getProviderId()

id from authentication provider.

Example:

provider_id: bookstore_auth

string provider_id = 1;

Returns
Type Description
String

The providerId.

getProviderIdBytes()

public ByteString getProviderIdBytes()

id from authentication provider.

Example:

provider_id: bookstore_auth

string provider_id = 1;

Returns
Type Description
ByteString

The bytes for providerId.

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(AuthRequirement other)

public AuthRequirement.Builder mergeFrom(AuthRequirement other)
Parameter
Name Description
other AuthRequirement
Returns
Type Description
AuthRequirement.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public AuthRequirement.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AuthRequirement.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public AuthRequirement.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
AuthRequirement.Builder
Overrides

setAudiences(String value)

public AuthRequirement.Builder setAudiences(String value)

NOTE: This will be deprecated soon, once AuthProvider.audiences is implemented and accepted in all the runtime components.

The list of JWT audiences. that are allowed to access. A JWT containing any of these audiences will be accepted. When this setting is absent, only JWTs with audience "https://Service_name/API_name" will be accepted. For example, if no audiences are in the setting, LibraryService API will only accept JWTs with the following audience "https://library-example.googleapis.com/google.example.library.v1.LibraryService".

Example:

audiences: bookstore_android.apps.googleusercontent.com, bookstore_web.apps.googleusercontent.com

string audiences = 2;

Parameter
Name Description
value String

The audiences to set.

Returns
Type Description
AuthRequirement.Builder

This builder for chaining.

setAudiencesBytes(ByteString value)

public AuthRequirement.Builder setAudiencesBytes(ByteString value)

NOTE: This will be deprecated soon, once AuthProvider.audiences is implemented and accepted in all the runtime components.

The list of JWT audiences. that are allowed to access. A JWT containing any of these audiences will be accepted. When this setting is absent, only JWTs with audience "https://Service_name/API_name" will be accepted. For example, if no audiences are in the setting, LibraryService API will only accept JWTs with the following audience "https://library-example.googleapis.com/google.example.library.v1.LibraryService".

Example:

audiences: bookstore_android.apps.googleusercontent.com, bookstore_web.apps.googleusercontent.com

string audiences = 2;

Parameter
Name Description
value ByteString

The bytes for audiences to set.

Returns
Type Description
AuthRequirement.Builder

This builder for chaining.

setProviderId(String value)

public AuthRequirement.Builder setProviderId(String value)

id from authentication provider.

Example:

provider_id: bookstore_auth

string provider_id = 1;

Parameter
Name Description
value String

The providerId to set.

Returns
Type Description
AuthRequirement.Builder

This builder for chaining.

setProviderIdBytes(ByteString value)

public AuthRequirement.Builder setProviderIdBytes(ByteString value)

id from authentication provider.

Example:

provider_id: bookstore_auth

string provider_id = 1;

Parameter
Name Description
value ByteString

The bytes for providerId to set.

Returns
Type Description
AuthRequirement.Builder

This builder for chaining.