net.geant.edugain.base
Class AuthorizationRequest

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

public class AuthorizationRequest
extends Request
implements java.io.Serializable

A request for an authorisation decision. It must contain the resource identifier and the attributes collected for the requesting entity, and may include references to the policies to be applied.

This class extends Request.

Version:
0.7
Author:
Jose Manuel Macias, Jaime Perez
See Also:
Serialized Form

Field Summary
protected  java.util.ArrayList<java.lang.String> actions
          An identifier for the action the requester is willing to perform on the resource.
private  java.net.URI attributeAuthority
          An optional URI of an eduGAIN instance that can help in making the authorisation decision by providing additional attributes.
private  java.util.ArrayList<AttributeValues> attributeValueList
          A list of the attributes (as established by the authentication procedures) provided by and/or obtained for the element requesting the authorisation.
private  java.lang.String homeSite
          Deprecated. 
private  org.apache.log4j.Logger log
           
protected  java.util.ArrayList<java.lang.String> policyReference
          An optional list of policy references to be applied in the decision.
protected  java.net.URI recipient
          Deprecated.  
protected  java.lang.String subjectHandle
          The identification string obtained upon the last successful authentication of the subject requesting access to the resource.
 
Fields inherited from class net.geant.edugain.base.Request
cacheReference, consumerId, producerId, requestID, resource
 
Constructor Summary
AuthorizationRequest()
          Creates a new instance of AuthorizationRequest
AuthorizationRequest(org.opensaml.saml1.core.RequestAbstractType request)
          Creates a new instance of AuthorizationRequest, filling the fields with the SAML 2 Request data received.
AuthorizationRequest(org.opensaml.SAMLRequest request)
          Creates a new instance of AuthorizationRequest, filling the fields with the SAMLRequest data received.
 
Method Summary
 void addAction(java.lang.String action)
          Adds the specified action to the current list.
 void fromSAML(org.opensaml.saml1.core.RequestAbstractType request)
          Fill this AuthorizationRequest from a SAML 2 Request
 void fromSAML(org.opensaml.SAMLRequest request)
          Fill this AuthorizationRequest from a SAMLRequest
 java.util.ArrayList<java.lang.String> getActions()
          Gets the list of actions for this request.
 java.net.URI getAttributeAuthority()
          Returns the attribute authority
 java.util.ArrayList<AttributeValues> getAttributeValueList()
          Gets the values for the attribute-value pair list
 java.lang.String getHomeSite()
          Deprecated.  
 java.util.ArrayList<java.lang.String> getPolicyReference()
          Gets the list of policy references
 java.net.URI getRecipient()
          Deprecated.  
 java.lang.String getSubjectHandle()
          Gets the value of the SubjectHandle
 void removeAction(java.lang.String action)
          Removes the specified action from the current list.
 void setAttributeAuthority(java.net.URI attributeAuthority)
          Sets the attribute authority
 void setAttributeValueList(java.util.ArrayList<AttributeValues> attributeValueList)
          Sets the list of elements - each of them corresponding to one attribute that the identity is willing to deliver upon successful authentication
 void setHomeSite(java.lang.String homeSite)
          Deprecated.  
 void setPolicyReference(java.util.ArrayList<java.lang.String> polRef)
          Sets the list of policy references
 void setRecipient(java.net.URI recip)
          Deprecated.  
 void setSubjectHandle(java.lang.String handle)
          Sets the subject handle
 java.lang.Object toSAML()
          Converts the eduGAIN AuthorizationRequest object into a SAML request.
private  org.opensaml.SAMLRequest toSAML1(int minor)
          Map the current AuthorizationRequest to a SAML 1.X response.
private  org.opensaml.saml2.core.RequestAbstractType toSAML2(int minor)
          Map the current AuthorizationRequest to a SAML 2.X response.
 
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

actions

protected java.util.ArrayList<java.lang.String> actions

An identifier for the action the requester is willing to perform on the resource. A string from a controlled vocabulary (see note below) and/or a formally defined URN can be used as value.

Note: actions as described here are meaningful in the corresponding application context, and thus are transparent to the eduGAIN infrastructure itself. User applications may establish their own sets of them, by means of multi- or bi-lateral agreements, requirements in the framework of policy management authorities, or even official standards where applicable.


attributeValueList

private java.util.ArrayList<AttributeValues> attributeValueList
A list of the attributes (as established by the authentication procedures) provided by and/or obtained for the element requesting the authorisation. Each individual element consists of an attribute name-value pair.


recipient

@Deprecated
protected java.net.URI recipient
Deprecated. 
An optional URI of an eduGAIN instance that can help in making the authorisation decision (e.g. by providing additional attributes).


homeSite

@Deprecated
private java.lang.String homeSite
Deprecated. 
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.


subjectHandle

protected java.lang.String subjectHandle
The identification string obtained upon the last successful authentication of the subject requesting access to the resource.


attributeAuthority

private java.net.URI attributeAuthority
An optional URI of an eduGAIN instance that can help in making the authorisation decision by providing additional attributes.


policyReference

protected java.util.ArrayList<java.lang.String> policyReference

An optional list of policy references to be applied in the decision. As in the action, the values can be strings from a controlled vocabulary and/or formally defined URNs.

TODO: If URN-coded, enumerate all the possible values.


log

private org.apache.log4j.Logger log
Constructor Detail

AuthorizationRequest

public AuthorizationRequest()
Creates a new instance of AuthorizationRequest


AuthorizationRequest

public AuthorizationRequest(org.opensaml.SAMLRequest request)
                     throws BaseException
Creates a new instance of AuthorizationRequest, filling the fields with the SAMLRequest data received.

Parameters:
request - The original SAML request.
Throws:
BaseException

AuthorizationRequest

public AuthorizationRequest(org.opensaml.saml1.core.RequestAbstractType request)
                     throws BaseException
Creates a new instance of AuthorizationRequest, filling the fields with the SAML 2 Request data received.

Parameters:
request - The original SAML request.
Throws:
BaseException
Method Detail

addAction

public void addAction(java.lang.String action)
Adds the specified action to the current list.


getActions

public java.util.ArrayList<java.lang.String> getActions()
Gets the list of actions for this request.

Returns:
The list of actions.

removeAction

public void removeAction(java.lang.String action)
Removes the specified action from the current list.

Parameters:
action - The action to remove.

getAttributeValueList

public java.util.ArrayList<AttributeValues> getAttributeValueList()
Gets the values for the attribute-value pair list


setAttributeValueList

public void setAttributeValueList(java.util.ArrayList<AttributeValues> attributeValueList)
Sets the list of elements - each of them corresponding to one attribute that the identity is willing to deliver upon successful authentication


setRecipient

@Deprecated
public void setRecipient(java.net.URI recip)
Deprecated. 

Sets the URI of a eduGAIN instance that can help making the authorization decision


getRecipient

@Deprecated
public java.net.URI getRecipient()
Deprecated. 

Gets the URI of a eduGAIN instance that can help making the authorization decision


setSubjectHandle

public void setSubjectHandle(java.lang.String handle)
Sets the subject handle


getSubjectHandle

public java.lang.String getSubjectHandle()
Gets the value of the SubjectHandle


setPolicyReference

public void setPolicyReference(java.util.ArrayList<java.lang.String> polRef)
Sets the list of policy references


getPolicyReference

public java.util.ArrayList<java.lang.String> getPolicyReference()
Gets the list of policy references


getAttributeAuthority

public java.net.URI getAttributeAuthority()
Returns the attribute authority


setAttributeAuthority

public void setAttributeAuthority(java.net.URI attributeAuthority)
Sets the attribute authority


getHomeSite

@Deprecated
public java.lang.String getHomeSite()
Deprecated. 

Returns the home site.


setHomeSite

@Deprecated
public void setHomeSite(java.lang.String homeSite)
Deprecated. 

Sets the home site.


fromSAML

public void fromSAML(org.opensaml.SAMLRequest request)
              throws BaseException
Fill this AuthorizationRequest from a SAMLRequest

Parameters:
request - The SAMLRequest
Throws:
BaseException

fromSAML

public void fromSAML(org.opensaml.saml1.core.RequestAbstractType request)
              throws BaseException
Fill this AuthorizationRequest from a SAML 2 Request

Parameters:
request - The SAML 2 Request
Throws:
BaseException

toSAML

public java.lang.Object toSAML()
                        throws BaseException
Converts the eduGAIN AuthorizationRequest object into a SAML request. Please consider that this method returns an OpenSAML1 or an OpenSAML2 Request object depending on the SAML version eduGAIN is configured to use.

Returns:
A SAMLRequest or a RequestAbstractType, depending on the SAML version eduGAIN is configured to use.
Throws:
BaseException

toSAML1

private org.opensaml.SAMLRequest toSAML1(int minor)
                                  throws BaseException
Map the current AuthorizationRequest to a SAML 1.X response.

Parameters:
minor - The minor version number (can be 0 or 1).
Returns:
The SAMLResponse that corresponds with this AuthorizationResponse.
Throws:
BaseException

toSAML2

private org.opensaml.saml2.core.RequestAbstractType toSAML2(int minor)
                                                     throws BaseException
Map the current AuthorizationRequest to a SAML 2.X response.

Parameters:
minor - The minor version number (can be 0 or 1).
Returns:
The Request that corresponds with this AuthorizationRequest.
Throws:
BaseException