> +
> +import com.google.common.base.Optional;
> +
> +@CredentialType(CredentialTypes.TOKEN_CREDENTIALS)
> +@Singleton
> +public class AuthenticateTokenCredentials extends
> BaseAuthenticator<TokenCredentials> {
> + protected final AuthenticationApi api;
> +
> + @Inject
> + public AuthenticateTokenCredentials(AuthenticationApi api) {
> + this.api = api;
> + }
> +
> + @Override
> + protected Access authenticateWithTenantName(Optional<String> tenantName,
> TokenCredentials apiAccessKeyCredentials) {
> + return
> api.authenticateWithTenantNameAndCredentials(tenantName.orNull(),
> apiAccessKeyCredentials);
`tenantName` can be null, and in that case we should send the request without a
`tenantName` field. Same goes with `tenantId`.
I guess it should be changed, I'll also update
`AuthenticatePasswordCredentials` since the same applies there.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/433/files#r17381545