gradle
8.4

# credentials

abstract fun <T : Credentials?> credentials(credentialsType: Class<T>, identity: String): Provider<T>(source)

Creates a Provider for the given Credentials type.

The provider returned by this method should be attached to a task's input property. This way, the presence of credentials will be validated before any of the tasks are executed if and only if the task with credentials property is to be executed.

Values for the requested Credentials type will be sourced from the project's properties using the pattern "identity" + credentials field. For example, PasswordCredentials provider with identity "myService" will look for properties named "myServiceUsername" and "myServicePassword".

The following credential types are currently supported:

- PasswordCredentials
- AwsCredentials

#### Return

The provider. Never returns null.

#### Parameters

credentialsType

type of credentials to be provided.

identity

identity to be associated with the credentials.

abstract fun <T : Credentials?> credentials(credentialsType: Class<T>, identity: Provider<String>): Provider<T>(source)

Creates a Provider for the given Credentials type.

The provider returned by this method should be attached to a task's input property. This way, the presence of credentials will be validated before any of the tasks are executed if and only if the task with credentials property is to be executed.

Values for the requested Credentials type will be sourced from the project's properties using the pattern "identity" + credentials field. For example, PasswordCredentials provider with identity "myService" will look for properties named "myServiceUsername" and "myServicePassword".

The following credential types are currently supported:

- PasswordCredentials
- AwsCredentials

#### Return

The provider. Never returns null.

#### Parameters

credentialsType

type of credentials to be provided.

identity

a provider returning the identity to be associated with the credentials.