Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The authorization policy is used to define what data is delivered to the applications behind Web Applications. In practice, the authorization policy adds attributes with name and value to the ticket response message for a web application. No other attributes are delivered to the web application. In this way, the information exposed about a user to applications can be restricted. For data security, it is best practice to send only the minimum amount of information required by the web application. For this reason, it is strongly recommended to use an authorization policy for all web applications.

An authorization policy can be used to assign Application-specific roles to users based on their group membership.

Arbitrary attribute names and values can be sent using the text tag. For example, if an application accepts an attribute called LOGONAME to customize the main screen appearance, this field could be set explicitly to EXAMPLE COMPANY for all users of that application.
Values from a user's directory record can be sent using arbitrary attribute names using the user tag. For example, if an application requires that the user mobile phone number is sent in a variable called MOBILE. User attribute data can optionally be Base64 encoded using the binary tag.

Attributes from Authentication Methods can also be optionally renamed and sent to Web Applications. For example, TUPAS sends Personal Identity Numbers in a field called CUSTID, which can be renamed to PERSONALID before passing to the application.

Authorization policies can be used for Attribute Based Access Control (ABAC) by checking for the presence or absence of a user or method attribute

The same authorization policy can be reused and assigned to many different web applications. A web application can only have one authorization policy assigned to it. Assigning a new Authorization Policy to a web application will replace the existing policy.

The ticket response protocol defines also special semantics for some attribute names, such as "username" and "role". The web application or web application that receives a ticket response message may implement functionality that is based on the ticket response attributes. For example, the Ubisecure BEA WebLogic Application implements J2EE declarative and programmatic authorization based on the values of the username and role attributes. The Ubisecure web application for ASP.NET implements MembershipProvider and RoleProvider based on the values of the username and role attributes, if Membership and Role Providers functions are used.

The main view of authorization policy is presented in Figure 1.

Figure 1: Authorization Policy main view
  • Ubilogin 2.x/3.0 backwards compatible
    Authorization Policy was changed in Ubisecure SSO version 3.1. Please see Release Notes for more information.
    When this feature is selected, Authorization Policy works as in Ubisecure SSO 3.0. This feature is used to ease the migration process from Ubisecure SSO 3.0.

    NOTE: By setting this value ON the web application can access all information that is derived from the used authentication method.

  • Single-Value Attributes
    Single-value constraint fails for the defined attribute if more than one distinct value is assigned
  • Required Attributes
    The required constraint fails for the defined attribute if no value is assigned


The components of the authorization policy consist of Single-Value and Required constraints. The constraints function is an aid for the application designer and legacy application compatibility. For example, if an application requires a mandatory attribute with the user information, for example email address, this check can be performed already by Ubisecure SSO. Similarly, if an application does not support multiple roles, this can be verified to ensure that only one role is sent during the authorization process. Thus, additional data validation at the application level is avoided.

If no Single-Value or Required attributes are set, no checking is performed on the Authorization Policy. Multiple attribute values with the same name can be sent and null values do not cause authorization failure.

If an attribute name is listed in the Single-Value Attribute list, authorization will fail if more than one attribute value with the same name is listed in the Authorization Policy.

If an attribute name is listed in both the Single-Value Attribute list and the Required Attributes list, that an attribute value with that name must be listed in the Authorization Policy. An attribute with a null value or more than one attribute with that name will cause authorization failure.

In summary, the default constraint allows 0..N values assigned per attribute, single-value allows 0..1 values, required allows 1..N, and the combination of single-value and required allows 1..1 values.
Authorization will not succeed if any of the constraints fail.


Roles

The Roles view presents a simplified view into the authorization policy where the Site Manager is allowed to manage group – role associations. See the Figure 2.

Figure 2: Authorization roles
  • Group
    Click Group or System name to edit group object
  • Update
    Edit role field and click Update to update group – role association
  • Add
    Click Add… to create a new association. By default the name of the group is used for the role name. You can change the role name. Any number of associations can be created. A single group may be associated with any number of roles.
  • Remove
    Select group check box and click Remove to remove group – role association.


Attributes

The Attributes view (see Figure 3) presents a more advanced view into the authorization policy.

Figure 3: Authorization Policy Attributes editor

In this view it is possible to associate groups and attributes of any name. The attribute value assigned to an attribute is entered as an attribute value.

  • Group
    Click group or site name to edit the group object
  • Name
    Name of the authorization attribute
  • Value
    Attribute value. See the syntax below.
  • Name Format
    SAML attribute name format, used in the SAML message. Usually not needed.
  • Friendly Name
    SAML attribute friendly name, used in the SAML message. Usually not needed.
  • Update
    Update the edited fields
  • Add
    Add new group – authorization association for to this authorization policy
  • Remove
    Remove the selected group – authorization association(s)


The syntax of the attribute value is as follows:

  • text:<string>
    → the value is <string>
  • user:<name>
    → the value is evaluated by reading the attribute <name> from the user's directory object. For example, user:uid would return the value of the uid attribute.
  • user:<name>;binary
    → LDAP binary option mechanism (http://www.rfc-editor.org/rfc/rfc2251.txt , Authentication and Authorization Process and Customizing SSO Management → Disabling Context Menu items). The attribute <name> is returned to web applications as Base64 coded string. For example, user:objectGuid;binary would return value such as sFy0xj0cXU6QpjsQRCzG5Q== .
  • method:<name>
    → the value is evaluated by reading the attribute <name> assigned by the authentication method component. The availability of method attributes depends on the authentication method implementation. For example, the CUSTID attribute is available with the Tupas 2 authentication method. method:CUSTID would then return the value of the CUSTID attribute from the Tupas 2 authentication process.

Java EL expressions

It is possible to use Java EL expressions in place of attribute values. This enables more complicated techniques available in Java EL syntax for building attribute values, such as concatenation of strings.

The convention used in this Java EL API documentation is:
For top level attributes:

  • attributeName [AttributeType]
    → Description of the attribute and its contents.
    • propertyName [PropertyType]
      → Description of the property.
    • methodName(Parameter1Type parameter1Name,…) [ReturnType]
      → Description of the method.

For top level functions:

  • prefix:functionName(Parameter1Type parameter1Name,…) [ReturnType]
    → Description of the function

Readable variables

Authorization Policy provides a number of variables whose properties can be read, but not written into. The variables are:

  • user [Bean]
    Contents depend on the type of the user directory.
    • LDAP: Contains all the attributes of the user’s entry in the directory, for example user.cn or user[‘cn’] resolves to the cn attribute of user in an LDAP user directory.
    • SQL: Contains all the attributes defined by UbiloginAuthorizer view.
  • method [Bean]
    → Contains all the attributes defined by the authentication method, after attribute mapping (see section 2.3) is applied.
    • Additionally, in case the Authorization Policy is registered to an OAuth2 –application, the method bean exposes following built-in attributes:
      • grant_type
        → The grant_type of the authentication request that was used for obtaining the token.
      • refresh_token_iat
        → If grant_type is refresh_token then this contains the create time of refresh_token.
  • prefix [Bean]
    → Contains the collection of all authorizer implementations registered in Ubisecure SSO, with their prefixes as keys.[PS1] [AÅ2] 
  • username [Bean]
    → Contains the properties of the user in the user directory. Changes to nameID variable are not reflected in this variable.
    • value [String]
    • handle [String]
    • format [String]
    • nameQualifier [String]
    • spNameQualifier [String]
    • spProvidedID [String]
  • sso [Bean]
    → Contains the following properties.
    • id [String] – SSO session ID. This should never be sent to an application as plain text. Instead sha1 digest should be used to create a transient session id, like ${sha1.text(sso.id).uuid}
    • locale [String] – Value of the current UI locale.
    • template [String] – Name of the current UI template.


Examples of use:

${user.cn}@example.com or ${user.cn[0].concat('@example.com')}

→ Get user’s CN attribute in the user directory and concatenate it with string ‘@example.com’. Both expressions are equivalent.

${sso.template}

→ Sends the name of the current template used

${sso.locale}

→ Sends the currently selected user interface locale

${server.decrypt(user.description)}

→ Sends the currently selected user description decrypted


Modifiable variables

Authorization Policy contains two variables, nameID and attribute, which allow modifications to their underlying models.

  • nameID [NameIDBuider]
    → (SAML only) The nameID element of the SAML Assertion to be sent to the application.
    • value(String s) [NameIDBuider]
      → Set the value of the nameID.
    • format(String s) [NameIDBuider]
      → Set the format of the nameID. Valid values are:
      • UNSPECIFIED ­
        → urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
      • EMAILADDRESS ­
        → urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
      • X509SUBJECTNAME ­
        → urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName
      • WINDOWSDOMAINQUALIFIEDNAME ­
        → urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName
      • KERBEROS ­
        → urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos
      • ENTITY ­
        → urn:oasis:names:tc:SAML:2.0:nameid-format:entity
    • nameQualifier(String s) [NameIDBuider]
      → Set the nameQualifier of the nameID.
    • spNameQualifier(String s) [NameIDBuider]
      → Set the spNameQualifier of the nameID.
    • spProvidedID(String s) [NameIDBuider]
      → Set the spProvidedID of the nameID.

 

  • attribute [AttributeBuilder]
    → The attribute in current authorization policy context, which will be sent to the application.
    • name(String s) [AttributeBuilder]
      → Set the name of the attribute. Note that this overrides the setting in authorization policy itself.
    • values(String s) [AttributeBuilder]
      → Add a value for the attribute.
    • nameFormat(String s) [AttributeBuilder]
      → Set the nameFormat of the attribute. Valid values are:
      • UNSPECIFIED
        → urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified
      • URI
        → urn:oasis:names:tc:SAML:2.0:attrname-format:uri
      • BASIC
        → urn:oasis:names:tc:SAML:2.0:attrname-format:basic
    • friendlyName(String s) [AttributeBuilder]
      → Set the friendlyName of the attribute.

 

Examples of use:

${attribute.name('role').values('manager')}

→ Set a value manager to attribute role.

${nameID.value(user.cn).format(‘x509subjectname’).nameQualifier(user.directory.name)} [PS3] 

→ Set user.cn [PS4] [AÅ5] as the value of the nameID, x509subject as its format and user.directory.name as its nameQualifier. This example shows how the methods can be chained.

${nameID.value(user.cn[0].concat('@example.com')).format('emailaddress')}

→ Set user.cn concatenated with @example.com as the value of nameID and emailaddress as its format.

${user.givenName[0].concat(' ').concat(user.sn[0])}

→ Returns the givenName concatenated with a whitespace character and the user surname.

${eidm['roles'].contains('Users/OrganizationMainUser') ? 'true' : 'false'}

→ Returns “true” if the user has the absolute CustomerID role Users/OrganizationMainUser. Otherwise “false” is returned.

${eidm['roles'].contains('Users/OrganizationMainUser') ? 'useradmin' : 'normaluser'}

→ Returns “useradmin” if the user has the absolute CustomerID role Users/OrganizationMainUser. Otherwise “normaluser” is returned.



Note that in the image above, there's the expression that sets the attribute's name to "role", so an attribute with name "name" would not be defined.

Helper variables

  • sha1 [DigestBuilder]
    → Helper for building SHA1 digest.
    • text(String input) [DigestBuilder]
      → Append input string to digest builder.
    • bytes(byte[] input) [DigestBuilder]
      → Append input bytearray to digest builder.
    • guid [UUID]
      → Convert digest to GUID.
    • uuid [UUID]
      → Convert digest to UUID.
  • sha256 [DigestBuilder]
    → Helper for building SHA256 digest.
    • text(String input) [DigestBuilder]
      → Append input string to digest builder.
    • bytes(byte[] input) [DigestBuilder]
      → Append input bytearray to digest builder.
    • guid [UUID]
      → Convert digest to GUID.
    • uuid [UUID]
      → Convert digest to UUID.

Examples of use:

${sha256.text(sso.id).uuid}

→ Create SHA256 digest of SSO Session ID and convert the digest to UUID.


Functions

  • xss:html(String input) [String]
    → Encode input string for HTML.
  • xss:url(String input) [String]
    → Encode input string for URL.
  • xss:js(String input) [String]
    → Encode input string for JavaScript.
  • xss:json(String input) [String]
    → Encode input string for JSON.
  • c14n:text(String input) [String]
    → Encode input string for Text Node in Canonical XML.
  • c14n:attr(String name, String input) [String]
    → Encode input string for Attribute Node name in Canonical XML.
  • base64:encode(byte[] input) [String]
    → Base64 encode input bytearray.
  • md5:encode(byte[] input) [String]
    → md5 encode input bytearray. (Requires SSO 6.9 or newer)
  • guid:encode(byte[] input) [String]
    → UUID/GUID encode bytearray. Array’s length must be 16 bytes.
  • utf8:bytes(string input) [byte[]]
    → UTF8 encode input string and convert to byte array.
  • digest:sha1(byte[] input) [byte[]]
    → SHA1 digest of input bytearray.
  • digest:sha256(byte[] input) [byte[]]
    → SHA256 digest of input bytearray.
  • re:replace(String input, String regex, String replacement) [String]
    → Replaces the first substring of input string that matches the given regular expression with the given replacement.

Examples of use:

${base64:encode(utf8:bytes(user.uid))} or ${base64:encode(utf8:bytes(user['uid'][0]))}

→ Base64 encode user.uid. Because base64:encode() function requires a bytearray as input parameter, and user.uid is String, it needs to be converted to bytearray using utf8:bytes().


Migration from old expressions to Java EL

All the authorization policy expressions in the old format can be converted to Java EL format. The conversion rules are:

user:property     

→ ${user.property} or ${user['property']}

user:property;binary
→ ${user['property;binary']} or ${encode:base64(user['property;binary'][0])}

user:../property
→ ${user.parent.property}

method:property
→ ${method.property}

text:Literal value
→ Literal value

prefix:xyz
→ ${prefix['xyz']}

Applications

This view shows the web applications where this authorization policy is assigned.

Figure 4: The list of applications that the selected authorization policy is applied to
  • Add
    Add a group to the selected authorization policy
  • Remove
    Remove the selected application(s) from this authorization policy


A single authorization policy may be assigned with any number of applications. A single application can be associated with one or zero authorization policies.

  • No labels