For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

authentication

Configures the authentication schemes for this repository.

This method executes the given action against the AuthenticationContainer for this project. The AuthenticationContainer is passed to the closure as the closure's delegate.

If no authentication schemes have been assigned to this repository, a default set of authentication schemes are used based on the repository's transport scheme.

repositories {
    maven {
        url = "https://example.com/m2"
        authentication {
            basic(BasicAuthentication)
        }
    }
}

Supported authentication scheme types extend org.gradle.authentication.Authentication.

Since

2.7

Parameters

action

the action to use to configure the authentication schemes.