wai-middleware-crowd-0.1.4.2: Middleware and utilities for using Atlassian Crowd authentication

Network.Wai.Middleware.Crowd

Contents

Synopsis

# Settings

Settings for creating the Crowd middleware.

To create a value, use defaultCrowdSettings and then various setter functions.

Since 0.1.0

Default value for CrowdSettings.

Since 0.1.0

Set the function to get client session key for encrypting cookie data.

Default: getDefaultKey

Since 0.1.0

Set the root of the Crowd service. This is used as an OpenID endpoint.

Default: http://localhost:8095/openidserver

Since 0.1.0

The application root for this application.

This is used for constructing completion URLs when communicating with Crowd's OpenID implementation.

Default: use the APPROOT environment variable.

Since 0.1.0

More generalized version of setCrowdApprootStatic.

Since 0.1.0

Acquire an HTTP connection manager.

Default: get a new tls-enabled manager.

Since 0.1.0

Number of seconds to keep an authentication cookie active

Default: 3600

Since 0.1.0

# Middleware

Create the Crowd middleware based on the given settings.

Since 0.1.0

# Helpers

Determine approot by:

• First respecting the APPROOT environment variable if present
• If not, respect the Host header and isSecure property, together with the following de facto standards: x-forwarded-protocol, x-forwarded-ssl, x-url-scheme, x-forwarded-proto, front-end-https. (Note: this list may be updated at will in the future without doc updates.)

Normally trusting headers in this way is insecure, however in the case of approot, the worst that can happen is that the client will get an incorrect URL. Note that this does not work for some situations, e.g.:

• Reverse proxies not setting one of the above mentioned headers
• Applications hosted somewhere besides the root of the domain name
• Reverse proxies that modify the host header

Since 0.1.0

Current version

Since 0.1.0

Get the username for the current user.

If called on a Request behind the middleware, should always return a Just value.

Since 0.1.1.0