com.hp.autonomy.hod.client.api.authentication.AuthenticationService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-hod-client Show documentation
Show all versions of java-hod-client Show documentation
Java Client for communicating with HP Haven OnDemand
/*
* Copyright 2015-2016 Hewlett-Packard Development Company, L.P.
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
*/
package com.hp.autonomy.hod.client.api.authentication;
import com.hp.autonomy.hod.client.api.authentication.tokeninformation.ApplicationTokenInformation;
import com.hp.autonomy.hod.client.api.authentication.tokeninformation.CombinedTokenInformation;
import com.hp.autonomy.hod.client.api.authentication.tokeninformation.DeveloperTokenInformation;
import com.hp.autonomy.hod.client.api.authentication.tokeninformation.UnboundTokenInformation;
import com.hp.autonomy.hod.client.api.authentication.tokeninformation.UserTokenInformation;
import com.hp.autonomy.hod.client.error.HodErrorException;
import com.hp.autonomy.hod.client.token.TokenProxy;
import java.util.Collection;
import java.util.List;
import java.util.UUID;
/**
* Service for making authentication requests to HP Haven OnDemand
*/
public interface AuthenticationService {
/**
* Acquire a token for an application
* @param apiKey The API key of the application
* @param applicationName The name of the application
* @param domain The domain of the application
* @param tokenType The type of the resulting token
* @param The type of the required token type
* @return A token for use with HP Haven OnDemand
* @throws HodErrorException
*/
TokenProxy authenticateApplication(
ApiKey apiKey,
String applicationName,
String domain,
T tokenType
) throws HodErrorException;
/**
* Acquire a token for a developer.
* @param apiKey The API key to use for authentication
* @param tenantUuid The UUID of the developer's tenant
* @param email The email address of the developer
* @return A token to authenticate requests made to Haven OnDemand
* @throws HodErrorException
*/
AuthenticationToken authenticateDeveloper(
ApiKey apiKey,
UUID tenantUuid,
String email
) throws HodErrorException;
/**
* Acquire an unbound application token for use with HP Haven OnDemand. This must be combined with an unbound user
* token before it can be used to query HP Haven OnDemand
* @param apiKey The application API key
* @return An unbound application token
* @throws HodErrorException
*/
AuthenticationToken authenticateUnbound(
ApiKey apiKey,
T tokenType
) throws HodErrorException;
/**
* Get applications and users which can be authenticated with the given authentication tokens.
* @param combinedSsoToken Combined SSO token obtained from the user agent
* @param appToken The application unbound authentication token
* @return A list of applications and users which can be authenticated
* @throws HodErrorException
*/
List authenticateCombinedGet(
AuthenticationToken combinedSsoToken,
AuthenticationToken appToken
) throws HodErrorException;
/**
* Obtain a combined SSO token from Haven OnDemand.
* @param combinedSsoToken Combined SSO token obtained from the user agent
* @param appToken The application unbound authentication token
* @param applicationDomain Domain of the application
* @param applicationName Name of the application
* @param tokenType The type of the returned token
* @return A combined token
* @throws HodErrorException
*/
AuthenticationToken authenticateCombined(
AuthenticationToken combinedSsoToken,
AuthenticationToken appToken,
String applicationDomain,
String applicationName,
T tokenType
) throws HodErrorException;
/**
* Obtain a combined SSO token from Haven OnDemand, explicitly specifying a user store.
* @param combinedSsoToken Combined SSO token obtained from the user agent
* @param appToken The application unbound authentication token
* @param applicationDomain Domain of the application
* @param applicationName Name of the application
* @param userStoreDomain Domain of the user store
* @param userStoreName Name of the user store
* @param tokenType The type of the returned token
* @return A combined token
* @throws HodErrorException
*/
AuthenticationToken authenticateCombined(
AuthenticationToken combinedSsoToken,
AuthenticationToken appToken,
String applicationDomain,
String applicationName,
String userStoreDomain,
String userStoreName,
T tokenType
) throws HodErrorException;
/**
* Get information from Haven OnDemand about a simple combined token.
* @param token The combined token
* @return Information about the combined token
* @throws HodErrorException
*/
CombinedTokenInformation getCombinedTokenInformation(AuthenticationToken token) throws HodErrorException;
/**
* Get information from Haven OnDemand about an HMAC combined token.
* @param token The combined token
* @return Information about the combined token
* @throws HodErrorException
*/
CombinedTokenInformation getHmacCombinedTokenInformation(AuthenticationToken token) throws HodErrorException;
/**
* Get information from Haven OnDemand about a developer token.
* @param token The developer token
* @return Information about the developer token
* @throws HodErrorException
*/
DeveloperTokenInformation getDeveloperTokenInformation(AuthenticationToken token) throws HodErrorException;
/**
* Get information from Haven OnDemand about the simple application token represented by the token proxy.
* @param tokenProxy The application token proxy
* @return Information about the application token
* @throws HodErrorException
*/
ApplicationTokenInformation getApplicationTokenInformation(TokenProxy tokenProxy) throws HodErrorException;
/**
* Get information from Haven OnDemand about the HMAC application token represented by a token proxy.
* @param tokenProxy The application token proxy
* @return Information about the application token
* @throws HodErrorException
*/
ApplicationTokenInformation getHmacApplicationTokenInformation(TokenProxy tokenProxy) throws HodErrorException;
/**
* Get information from Haven OnDemand about the simple user token represented by a token proxy.
* @param tokenProxy The user token proxy
* @return Information about the user token
* @throws HodErrorException
*/
UserTokenInformation getUserTokenInformation(TokenProxy tokenProxy) throws HodErrorException;
/**
* Get information from Haven OnDemand about the HMAC user token represented by a token proxy.
* @param tokenProxy The user token proxy
* @return Information about the user token
* @throws HodErrorException
*/
UserTokenInformation getHmacUserTokenInformation(TokenProxy tokenProxy) throws HodErrorException;
/**
* Get information from Haven OnDemand about a simple unbound token.
* @param token The about an unbound token
* @return Information about the about an unbound token
* @throws HodErrorException
*/
UnboundTokenInformation getUnboundTokenInformation(AuthenticationToken token) throws HodErrorException;
/**
* Get information from Haven OnDemand about an HMAC unbound token.
* @param token The about an unbound token
* @return Information about the about an unbound token
* @throws HodErrorException
*/
UnboundTokenInformation getHmacUnboundTokenInformation(AuthenticationToken token) throws HodErrorException;
/**
* Get a representation of a request for obtaining a list of applications and domains associated with the given unbound
* token. This request must then be made from a browser.
* @param allowedOrigins Origins from which this request may be sent
* @param token The unbound token to use to sign the request
* @return A representation of an AJAX request to make from a browser
*/
SignedRequest combinedGetRequest(
Collection allowedOrigins,
AuthenticationToken token
);
/**
* Get a representation of a request for obtaining a combined SSO token from Haven OnDemand. No redirect URL is
* included in the request signature.
* @param allowedOrigins Origins from which this request may be sent
* @param token The unbound token to use to sign the request
* @return A representation of an AJAX request to make from a browser from one of the allowedOrigins
*/
SignedRequest combinedPatchRequest(
Collection allowedOrigins,
AuthenticationToken token
);
/**
* Get a representation of a request for obtaining a combined SSO token from Haven OnDemand. Includes a redirect URL
* in the request signature.
* @param allowedOrigins Origins from which this request may be sent
* @param redirectUrl Redirect URL to sign
* @param token The unbound token to use to sign the request
* @return A representation of an AJAX request to make from a browser from one of the allowedOrigins
*/
SignedRequest combinedPatchRequest(
Collection allowedOrigins,
String redirectUrl,
AuthenticationToken token
);
/**
* Get a representation of a request for obtaining a combined token from Haven OnDemand. This request must be made
* from a browser. No nonce is included.
* @param allowedOrigins Origins from which this request may be sent
* @param token The unbound token to use to sign the request
* @param applicationDomain Domain of the application
* @param applicationName Name of the application
* @param tokenType The type of the returned token
* @return A representation of an AJAX request to make from a browser
*/
SignedRequest combinedRequest(
Collection allowedOrigins,
AuthenticationToken token,
String applicationDomain,
String applicationName,
TokenType tokenType
);
/**
* Get a representation of a request for obtaining a combined token from Haven OnDemand, specifying a user store. This
* request must be made from a browser. No nonce is included.
* @param allowedOrigins Origins from which this request may be sent
* @param token The unbound token to use to sign the request
* @param applicationDomain Domain of the application
* @param applicationName Name of the application
* @param userStoreDomain Domain of the user store
* @param userStoreName Name of the user store
* @param tokenType The type of the returned token
* @return A representation of an AJAX request to make from a browser
*/
SignedRequest combinedRequest(
Collection allowedOrigins,
AuthenticationToken token,
String applicationDomain,
String applicationName,
String userStoreDomain,
String userStoreName,
TokenType tokenType
);
/**
* Get a representation of a request for obtaining a combined token from Haven OnDemand, specifying a user store. This
* request must be made from a browser. A random unique nonce is included if useNonce is true.
* @param allowedOrigins Origins from which this request may be sent
* @param token The unbound token to use to sign the request
* @param applicationDomain Domain of the application
* @param applicationName Name of the application
* @param userStoreDomain Domain of the user store
* @param userStoreName Name of the user store
* @param tokenType The type of the returned token
* @param useNonce If true, a nonce will be generated and included in the request
* @return A representation of an AJAX request to make from a browser
*/
SignedRequest combinedRequest(
Collection allowedOrigins,
AuthenticationToken token,
String applicationDomain,
String applicationName,
String userStoreDomain,
String userStoreName,
TokenType tokenType,
boolean useNonce
);
}