Skip to content

auth-scheme-not-supported

Id
@azure-tools/typespec-java/auth-scheme-not-supported

Severity: warning

This diagnostic is issued when an authentication scheme cannot be represented by the selected Java client flavor.

The generated client may omit the scheme or fall back to a less specific credential type.

@service
@useAuth(ApiKeyAuth<ApiKeyLocation.query, "api-key">)
namespace Contoso;
@service
@useAuth(BasicAuth)
namespace Contoso;

The message identifies the unsupported scheme, location, or flavor. For example:

ApiKey auth is currently only supported for ApiKeyLocation.header.

Use OAuth2 authentication.

@service
@useAuth(OAuth2Auth<[OAuthFlow]>)
namespace Contoso;
model OAuthFlow {
type: OAuth2FlowType.clientCredentials;
tokenUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/token";
scopes: ["https://contoso.com/.default"];
}

Do not suppress this warning unless custom code will provide the intended authentication behavior.