net.geant.edugain.base
Class AuthenticationRequest

java.lang.Object
  extended by net.geant.edugain.base.Request
      extended by net.geant.edugain.base.AuthenticationRequest
All Implemented Interfaces:
java.io.Serializable

public class AuthenticationRequest
extends Request
implements java.io.Serializable

A request for authentication data about the subject requesting a service. It may imply a redirection to the home domain in order to perform a direct exchange of credentials.

This class extends Request.

Author:
Jose Manuel Macias
See Also:
Serialized Form

Field Summary
private  java.lang.String authenticatingPrincipal
          A string (simple or in URN format) that identifies the principal [username/object] that is requesting the authentication.
private  java.net.URI authenticationMethod
          URI that identifies a authentication method (e.g.
private  java.lang.String authnType
          A identification of the protocol used in the authentication.
private  java.util.ArrayList<HomeLocator> homeLocators
          A list of data that will be used by the Metadata Service to evaluate the request.
protected  java.lang.String homeSite
          The home site of the user where the request is going to be solved.
private  org.apache.log4j.Logger log
           
private  java.net.URI providerId
          The id of the provider who created this authentication request.
protected  java.net.URI shire
          The URI from where the requester has been redirected to this service.
private  org.opensaml.common.SAMLVersion version
          The SAML version of the current Authentication Request.
 
Fields inherited from class net.geant.edugain.base.Request
cacheReference, consumerId, producerId, requestID, resource
 
Constructor Summary
AuthenticationRequest()
          Creates a new instance of an AuthenticationRequest object (authentication request).
AuthenticationRequest(org.opensaml.saml2.core.AuthnRequest request)
          Creates a new instance of an AuthenticationRequest object (authentication request) based on a given OpenSAML2 AuthnRequest object.
AuthenticationRequest(org.opensaml.SAMLRequest request)
          Creates a new instance of an AuthenticationRequest object (authentication request) based on a given SAMLRequest object.
AuthenticationRequest(java.net.URI res)
          Creates a new instance of an AuthenticationRequest object (authentication request) for the given resource (expressed as an URI).
 
Method Summary
 void fromSAML(org.opensaml.saml2.core.AuthnRequest request)
          Fill this AuthenticationRequest from an OpenSAML2 Authentication Request.
 void fromSAML(org.opensaml.SAMLRequest sreq)
          Fill this AuthenticationRequest from a SAMLRequest
 java.lang.String getAuthenticatingPrincipal()
          Gets the reference of the subject (principal) that is requesting the authentication.
 java.net.URI getAuthMethod()
          Gets the authentication method to be used
 java.lang.String getAuthType()
          Returns the value of the authentication type field
 java.util.ArrayList<HomeLocator> getHomeLocators()
          Returns the list of home locators
 java.lang.String getHomeSite()
          Gets the value of the HomeSite
 java.net.URI getProviderId()
          Gets the identifier of the provider who created this request.
 java.net.URI getShire()
          Gets the URI from where the requester was redirected to this service
 void setAuthenticatingPrincipal(java.lang.String principal)
          Sets the reference for the subject (principal) that is requesting the authentication.
 void setAuthMethod(java.net.URI method)
          Sets the authentication method to be used
 void setAuthType(java.lang.String authType)
          Sets a value for the authentication type field
 void setHomeLocators(java.util.ArrayList<HomeLocator> homeLocators)
          Sets the list of home locators
 void setHomeSite(java.lang.String homesite)
          Sets the HomeSite
 void setProviderId(java.net.URI providerId)
          Sets the identifier of the provider who created this request.
 void setShire(java.net.URI ref)
          Sets the URI from where the requester was redirected to this service
 org.opensaml.SAMLRequest toSAML()
          Converts this eduGAIN AuthenticationRequest object into a SAMLRequest
 
Methods inherited from class net.geant.edugain.base.Request
generateRequestID, getCacheReference, getConsumerId, getIssued, getProducerId, getRequestID, getResource, getValidatedTrust, setCacheReference, setConsumerId, setIssued, setProducerId, setRequestID, setRequestID, setResource, setValidatedTrust
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

authnType

private java.lang.String authnType
A identification of the protocol used in the authentication.


authenticationMethod

private java.net.URI authenticationMethod
URI that identifies a authentication method (e.g. password, PKI) to be used to authenticate the subject.


authenticatingPrincipal

private java.lang.String authenticatingPrincipal
A string (simple or in URN format) that identifies the principal [username/object] that is requesting the authentication.


homeSite

protected java.lang.String homeSite
The home site of the user where the request is going to be solved. This value corresponds to the ConnectTo value in the HomeLocationRequest operation.


shire

protected java.net.URI shire
The URI from where the requester has been redirected to this service.


homeLocators

private java.util.ArrayList<HomeLocator> homeLocators
A list of data that will be used by the Metadata Service to evaluate the request. Each individual locator consists of an attribute-value pair.


providerId

private java.net.URI providerId
The id of the provider who created this authentication request.


version

private org.opensaml.common.SAMLVersion version
The SAML version of the current Authentication Request.


log

private org.apache.log4j.Logger log
Constructor Detail

AuthenticationRequest

public AuthenticationRequest()
Creates a new instance of an AuthenticationRequest object (authentication request).


AuthenticationRequest

public AuthenticationRequest(java.net.URI res)
Creates a new instance of an AuthenticationRequest object (authentication request) for the given resource (expressed as an URI).


AuthenticationRequest

public AuthenticationRequest(org.opensaml.SAMLRequest request)
                      throws BaseException
Creates a new instance of an AuthenticationRequest object (authentication request) based on a given SAMLRequest object.

Parameters:
request - the SAML request to translate into eduGAIN
Throws:
BaseException

AuthenticationRequest

public AuthenticationRequest(org.opensaml.saml2.core.AuthnRequest request)
                      throws BaseException
Creates a new instance of an AuthenticationRequest object (authentication request) based on a given OpenSAML2 AuthnRequest object.

Parameters:
request - the authentication request to translate into eduGAIN
Throws:
BaseException
Method Detail

setAuthMethod

public void setAuthMethod(java.net.URI method)
Sets the authentication method to be used


getAuthMethod

public java.net.URI getAuthMethod()
Gets the authentication method to be used


setAuthenticatingPrincipal

public void setAuthenticatingPrincipal(java.lang.String principal)
Sets the reference for the subject (principal) that is requesting the authentication.


getAuthenticatingPrincipal

public java.lang.String getAuthenticatingPrincipal()
Gets the reference of the subject (principal) that is requesting the authentication.


setHomeSite

public void setHomeSite(java.lang.String homesite)
Sets the HomeSite


getHomeSite

public java.lang.String getHomeSite()
Gets the value of the HomeSite


setShire

public void setShire(java.net.URI ref)
Sets the URI from where the requester was redirected to this service


getShire

public java.net.URI getShire()
Gets the URI from where the requester was redirected to this service


getAuthType

public java.lang.String getAuthType()
Returns the value of the authentication type field


setAuthType

public void setAuthType(java.lang.String authType)
Sets a value for the authentication type field


getHomeLocators

public java.util.ArrayList<HomeLocator> getHomeLocators()
Returns the list of home locators


setHomeLocators

public void setHomeLocators(java.util.ArrayList<HomeLocator> homeLocators)
Sets the list of home locators


getProviderId

public java.net.URI getProviderId()
Gets the identifier of the provider who created this request.


setProviderId

public void setProviderId(java.net.URI providerId)
Sets the identifier of the provider who created this request.


fromSAML

public void fromSAML(org.opensaml.SAMLRequest sreq)
              throws BaseException
Fill this AuthenticationRequest from a SAMLRequest

Parameters:
sreq - The SAMLRequest
Throws:
BaseException

toSAML

public org.opensaml.SAMLRequest toSAML()
                                throws BaseException
Converts this eduGAIN AuthenticationRequest object into a SAMLRequest

Returns:
SAMLRequest The SAMLRequest representation of the eduGAIN AuthenticationRequest
Throws:
BaseException

fromSAML

public void fromSAML(org.opensaml.saml2.core.AuthnRequest request)
              throws BaseException
Fill this AuthenticationRequest from an OpenSAML2 Authentication Request.

Parameters:
request - the original Authentication Request.
Throws:
BaseException