public class VcdMultisiteLoginCredentials extends Object implements ClientCredentials
ClientCredentials, the credentials here are inserted by the
MultisiteAuthorizationFilter when we also know the body of the message. Signature
string created in partial compliance with
https://tools.ietf.org/html/draft-cavage-http-signatures-06
Steps for signature:\n
1. During creation of the request getHeaderValue() is used to add
to the Authorization header.\n
2. When sending the request, the MultisiteAuthorizationFilter intercepts the request.
3. The authorization header is crafted using {@link #createMultisiteAuthorizationHeader(String, String, String, String, byte[])
and inserted by the filter.| Modifier and Type | Field and Description |
|---|---|
static String |
AUTH_TYPE |
static String |
MULTISITE_BASIC_AUTH_HEADER_TEMPLATE |
static String |
MULTISITE_BASIC_AUTH_USERORG_TEMPLATE |
static String |
MULTISITE_SSO_AUTH_HEADER_TEMPLATE |
| Constructor and Description |
|---|
VcdMultisiteLoginCredentials(UUID localSiteId,
UUID localOrgId,
String ssoCredentials,
String pemEncodedKey)
Construct the multisite credentials with the key to sign with and the SSO credentials of the
user the multisite request is made on behalf of
|
VcdMultisiteLoginCredentials(UUID localSiteId,
UUID localOrgId,
String userName,
String orgName,
String pemEncodedKey)
Construct the multisite credentials with the key to sign with and basic credentials of the
user the multisite request is made on behalf of
|
| Modifier and Type | Method and Description |
|---|---|
String |
createMultisiteAuthorizationHeader(String date,
String method,
String path,
byte[] contentBytes)
Create the multisite authorization header from the provided information
|
String |
getHeaderName()
Returns the name of the HTTP header used for authentication in a REST request
|
String |
getHeaderValue()
Renders client authentication credentials in a form suitable to be used
as the value in a header whose name is returned by
ClientCredentials.getHeaderName() |
boolean |
supportsSessionless()
Indicates whether the ClientCredentials supports session-less requests.
|
public static final String AUTH_TYPE
public static final String MULTISITE_BASIC_AUTH_HEADER_TEMPLATE
public static final String MULTISITE_SSO_AUTH_HEADER_TEMPLATE
public static final String MULTISITE_BASIC_AUTH_USERORG_TEMPLATE
public VcdMultisiteLoginCredentials(UUID localSiteId, UUID localOrgId, String userName, String orgName, String pemEncodedKey) throws IOException
localSiteId - local site UUIDlocalOrgId - local Org UUIDuserName - UserName to login withorgName - org to log intoprivateKey - Private key to sign the contents withIOExceptionpublic VcdMultisiteLoginCredentials(UUID localSiteId, UUID localOrgId, String ssoCredentials, String pemEncodedKey) throws IOException
localSiteId - local site UUIDlocalOrgId - local Org UUIDssoCredentials - User sso credentials for whom the multi-site request is being madeprivateKey - Private key to sign the contents withIOExceptionpublic String getHeaderName()
ClientCredentialsgetHeaderName in interface ClientCredentialspublic String getHeaderValue()
ClientCredentialsClientCredentials.getHeaderName()getHeaderValue in interface ClientCredentialspublic boolean supportsSessionless()
ClientCredentialssupportsSessionless in interface ClientCredentialspublic String createMultisiteAuthorizationHeader(String date, String method, String path, byte[] contentBytes)
date - Current date in RFC_1123_DATE_TIME formatmethod - Rest methodpath - path of the request (e.g. '/cloud/org')host - Destination of the requestcontentBytes - Byte array of the contentCopyright © 2019 VMware. All rights reserved.