← Back to plugin index

Username Cookie Identity Propagator

Description
Simple cookie based identity propagator that sets a cookie containing the user name.

This identity propagator can be used together with Airlock Gateway (WAF) to send a cookie bearing the username to back-end applications.

Type name
UsernameCookieIdentityPropagator
Class
com.airlock.iam.core.misc.impl.sso.UsernameCookieIdentityPropagator
May be used by
Properties
Cookie Name (cookieName)
Description
The name of the cookie to be sent to the browser or Airlock Gateway (WAF).
Attributes
String
Optional
Default value
username
Example
auth_cookie
Example
username
Cookie Path (cookiePath)
Description
The path for which the cookie is set. The path determines where the cookie is sent by the reverse proxy (or browser).

If one single access cookie is used for all applications, the value "/" can be used. If different tickets are used for different applications, the applications path should be used.

Note that only one access cookie per cookie path and name can exist. Make sure that this cookie name does not clash with other cookie's names. For example, do not use session cookie names such as "JSESSIONID".

Make sure the configuration flag Interpret Cookie Domains is set in the Airlock Gateway (WAF) configuration. If not, the cookie path is ignored and cookies in the cookie store are sent to any back-end HTTP request of the same session. This also means that there may be only one cookie per cookie name!
It is best to consult the corresponding documentation of the Airlock Gateway to get more accurate information on cookie handling.

Attributes
String
Optional
Default value
/
Example
/
Example
/appl1
Example
/appl2
Cookie Domain (cookieDomain)
Description
The domain for which the cookie is set. The domain determines where the cookie is sent by the reverse proxy (or browser).

Because of security restrictions in browsers (same origin policy) it is usually not possible to set a cookie for a different domain unless the right-most two domain parts (e.g. "ergon.ch") are equal to that of the application setting the cookie.
It is possible that there are further restrictions regarding this in browsers.

If you are using a HTTP reverse proxy that stores the cookie in its session store (and does not send it to the client), make sure to understand the proxies interpretation of the cookie domain and cookie path.

Make sure the configuration flag Interpret Cookie Domains is set in the Airlock Gateway (WAF) configuration. If not, the cookie domain is ignored and cookies in the cookie store are sent to any back-end HTTP request of the same session. The cookie path is also ignored meaning that there may be only one cookie per cookie name!
Airlock also supports the following cookie domain values (if the flag Interpret Cookie Domains is set):

  • The value .* results in cookies being sent to all back-end servers. This is especially useful if one authentication ticket is used for multiple back-ends.
  • The value @<fully-qualified-host> results in the cookie being treated as if it were set by the host specified by "<fully-qualified-host>". If using this value, make sure the corresponding mapping also uses the fully qualified hostname.
It is best to consult the corresponding documentation of the Airlock Gateway to get more accurate information on cookie handling.

Note that only one cookie per cookie path and name can exist. Make sure that this cookie name does not clash with other cookie's names. For example, do not use session cookie names such as "JSESSIONID".

Attributes
String
Optional
Example
@anotherbackend.com
Example
.*
Example
mybackend.com
Set Secure Flag (setSecureFlag)
Description
If set to TRUE the "secure"-flag of the cookie is set.

If the cookie is marked as secure, the browser (and any HTTP proxy behaving like a browser) should send the cookie only over secure connections.
Caution: If you think that setting this flag makes your application more secure, it is in most cases way better to adequately secure the access cookie by encrypting it appropriately. Remember that this flag just "asks" the browser to not transmit the cookie over unencrypted connections.

Attributes
Boolean
Optional
Default value
false
Url Encoding Scheme (urlEncodingScheme)
Description
String values must be URL encoded in order to be suitable as cookie values. This optional property defines the URL encoding scheme to be used.
Make sure that the component receiving the ticket uses the same URL encoding scheme.
Specify NONE to disable URL-Encoding in case the target system cannot handle URL-Encoded cookies. Notice: This will only work if the username contains nothing but ASCII characters. Other characters like umlauts are never allowed unencoded in cookies and will result in an error.
Attributes
String
Optional
Default value
UTF-8
Allowed values
UTF-8, ISO-8859-1, UTF-16, UTF-16BE, UTF-16LE, US-ASCII, ISO-8859-15, NONE
Max Age (maxAge)
Description
Sets the maximum age in seconds for this Cookie.
  • A positive value indicate that the cookie will expire after that many seconds have passed.
  • A negative value means that the cookie is not stored persistently and will usually be deleted when the Web browser exits (however, browsers may keep it for longer).
  • A value of 0 (zero) causes the cookie to be deleted by sending an expired cookie with the same name.
Attributes
Integer
Optional
Default value
-1
YAML Template (with default values)

type: UsernameCookieIdentityPropagator
id: UsernameCookieIdentityPropagator-xxxxxx
displayName: 
comment: 
properties:
  cookieDomain:
  cookieName: username
  cookiePath: /
  maxAge: -1
  setSecureFlag: false
  urlEncodingScheme: UTF-8