WebSphere Portal 5.0.0.0

com.ibm.wps.portletservice.credentialvault.credentials
Class LtpaTokenCredential

java.lang.Object
  |
  +--com.ibm.wps.portletservice.credentialvault.credentials.Credential
        |
        +--com.ibm.wps.portletservice.credentialvault.credentials.ActiveCredential
              |
              +--com.ibm.wps.portletservice.credentialvault.credentials.JaasSubjectCredential
                    |
                    +--com.ibm.wps.portletservice.credentialvault.credentials.LtpaTokenCredential
All Implemented Interfaces:
java.io.Serializable

public class LtpaTokenCredential
extends JaasSubjectCredential

Credential for authenticating at a back-end system that is within the same AppServer SSO-Domain as the portal. The credential needs to be provided in form of the portal's JAAS Subject, containing a private credential that holds the user's LtpaToken. To be used in following way:

  1. Construct (initialize) the credential
  2. Pass an HttpURLConnection to the credential in order to add the LtpaToken to the request header ("getAuthenticatedConnection")
  3. If necessary, set additional HTTP headers
  4. Send the request
Preconditions: Assumptions:

See Also:
Serialized Form

Fields inherited from class com.ibm.wps.portletservice.credentialvault.credentials.Credential
KEY_CREDENTIAL_SECRET
 
Constructor Summary
LtpaTokenCredential()
           
 
Method Summary
 java.net.HttpURLConnection getAuthenticatedConnection(java.lang.String url)
          Returns a new HttpURLConnection with added authentication data.
 java.net.HttpURLConnection getAuthenticatedConnection(java.net.URL url)
          Returns a new HttpURLConnection with added authentication data.
 void init(java.util.Map config)
          Creates a new LtpaTokenCredential.
 
Methods inherited from class com.ibm.wps.portletservice.credentialvault.credentials.JaasSubjectCredential
getSecretType
 
Methods inherited from class com.ibm.wps.portletservice.credentialvault.credentials.ActiveCredential
isActive
 
Methods inherited from class com.ibm.wps.portletservice.credentialvault.credentials.Credential
getCredentialSlotParameters
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LtpaTokenCredential

public LtpaTokenCredential()
Method Detail

init

public void init(java.util.Map config)
          throws java.lang.Exception
Creates a new LtpaTokenCredential.
Overrides:
init in class JaasSubjectCredential
Parameters:
Map - The configuration needed to initialize this credential:
  • KEY_CREDENTIAL_SECRET JaasSubjectCredentialSecret - the credential's secret (mandatory)
Throws:
java.lang.Exception - If any mandatory parameter is missing or has a wrong object type as value.

getAuthenticatedConnection

public java.net.HttpURLConnection getAuthenticatedConnection(java.net.URL url)
                                                      throws java.io.IOException
Returns a new HttpURLConnection with added authentication data.
Overrides:
getAuthenticatedConnection in class JaasSubjectCredential
Parameters:
HttpURLConnection - the traget URL for the connection. Note that it need not be opened yet.
Returns:
HttpURLConnection A new authenticated (and yet uncommitted) connection
Throws:
java.io.IOException - thrown if anything unexpected happened

getAuthenticatedConnection

public java.net.HttpURLConnection getAuthenticatedConnection(java.lang.String url)
                                                      throws java.io.IOException
Returns a new HttpURLConnection with added authentication data.
Overrides:
getAuthenticatedConnection in class JaasSubjectCredential
Parameters:
String - the traget URL for the connection
Returns:
HttpURLConnection A new authenticated (and yet uncommitted) connection.
Throws:
java.io.IOException - thrown if anything unexpected happened.

WebSphere Portal 5.0.0.0