com.opengamma.sdk.common.auth.AuthClient Maven / Gradle / Ivy
Show all versions of sdk-common Show documentation
/*
* Copyright (C) 2016 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.sdk.common.auth;
import com.opengamma.sdk.common.ServiceInvoker;
/**
* Client providing access to the auth service.
*
* Applications should not need to use this service directly.
* The {@link ServiceInvoker} invokes authentication when required.
*
* @deprecated Since 1.3.0. Replaced by {@link com.opengamma.sdk.common.auth.v3.AuthClient} with an updated implementation.
* The current interface will be removed in future versions.
*/
@Deprecated
public interface AuthClient {
/**
* Obtains an instance.
*
* @param invoker the service invoker
* @return the client
*/
public static AuthClient of(ServiceInvoker invoker) {
return InvokerAuthClient.of(invoker);
}
//-------------------------------------------------------------------------
/**
* Authenticates the user based on a username and password.
*
* @param username the username
* @param password the password
* @return the result containing the access token
*/
public abstract AccessTokenResult authenticatePassword(String username, String password);
/**
* Authenticates the user based on an API key.
*
* @param apiKey the API key
* @param apiKeySecret the secret
* @return the result containing the access token
*/
public abstract AccessTokenResult authenticateApiKey(String apiKey, String apiKeySecret);
/**
* Refreshes the main token based on the refresh token.
*
* @param refreshToken the refresh token
* @return the result containing the access token
*/
public abstract AccessTokenResult refreshToken(String refreshToken);
}