OpenID Connect Federation Protocol

The CAS server supports the OpenID Federation protocol.

It can act as only one of the following roles (mutually exclusive):

  • Trust Anchor (TA)
  • Intermediate
  • OpenID Provider (OP)

Support is enabled by including the following dependency in the WAR overlay:

1
2
3
4
5
<dependency>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-server-support-oidc-federation</artifactId>
    <version>${cas.version}</version>
</dependency>
1
implementation "org.apereo.cas:cas-server-support-oidc-federation:${project.'cas.version'}"
1
2
3
4
5
6
7
8
9
dependencyManagement {
    imports {
        mavenBom "org.apereo.cas:cas-server-support-bom:${project.'cas.version'}"
    }
}

dependencies {
    implementation "org.apereo.cas:cas-server-support-oidc-federation"
}
1
2
3
4
5
6
7
8
9
10
dependencies {
    /*
        The following platform references are included automatically and are listed for reference only.

        implementation enforcedPlatform("org.apereo.cas:cas-server-support-bom:${project.'cas.version'}")
        implementation platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
        
    */
    implementation "org.apereo.cas:cas-server-support-oidc-federation"
}

Configuration

The following settings and properties are available from the CAS configuration catalog:

cas.authn.oidc.federation.authority-hintsThe List of federation authorities where this entity is enrolled.
no default
Required

The List of federation authorities where this entity is enrolled. This is used to generate the federation metadata and the entries are also considered trust anchors when validating incoming federation requests from relying parties.

Type
List<String>
Default
none
Defined by
OidcFederationProperties
cas.authn.oidc.federation.contactsList of contacts to include in the federation metadata.
no default
Required

List of contacts to include in the federation metadata.

Type
List<String>
Default
none
Defined by
OidcFederationProperties
cas.authn.oidc.federation.jwks-filePath to the JWKS file resource used to handle signing of federation metadata.
file:/etc/cas/config/federation-keystore.jwks
RequiredSpEL

Path to the JWKS file resource used to handle signing of federation metadata. Note that if the keystore file does not exist at the specified path, one will be generated for you.

Type
String
Default
file:/etc/cas/config/federation-keystore.jwks
Defined by
OidcFederationProperties
Supports
Spring Expression Language
cas.authn.oidc.federation.organizationOrganization name to include in the federation metadata.
Apereo CAS
Required

Organization name to include in the federation metadata.

Type
String
Default
Apereo CAS
Defined by
OidcFederationProperties
cas.authn.oidc.federation.roleThe role of this server.
no default
Required
The role of this server. Available values are as follows:
  • TRUST_ANCHOR: The root of trust entity issuing statements about other entities.
  • INTERMEDIATE: Intermediate entity between the trust anchor and the leaf entities.
  • OPENID_PROVIDER: Leaf entity playing the OpenID Connect provider protocol role.
Type
OidcFederationRole
Default
none
Defined by
OidcFederationProperties
cas.authn.oidc.federation.entity-statement-expirationSets the time period during which the entity statement is not expired.
P90D
Duration

Sets the time period during which the entity statement is not expired.

Type
String
Default
P90D
Defined by
OidcFederationProperties
cas.authn.oidc.federation.subordinate-directoryFor a TA or intermediate, the file directory where the subordinates are stored.
no default

For a TA or intermediate, the file directory where the subordinates are stored.

Type
String
Default
none
Defined by
OidcFederationProperties

Required settings may be needed to activate or affect the feature; review them even when they have a default. Optional settings only need to be set to change a default or to turn on the behavior they control. Third party settings belong to libraries such as Spring Boot that CAS builds on; their own documentation may have more detail.

Notes on configuration

Configuration Metadata

The collection of configuration properties listed in this section are automatically generated from the CAS source and components that contain the actual field definitions, types, descriptions, modules, etc. This metadata may not always be 100% accurate, or could be lacking details and sufficient explanations.

Be Selective

This section is meant as a guide only. Do NOT copy/paste the entire collection of settings into your CAS configuration; rather pick only the properties that you need. Do NOT enable settings unless you are certain of their purpose and do NOT copy settings into your configuration only to keep them as reference. All these ideas lead to upgrade headaches, maintenance nightmares and premature aging.

YAGNI

Note that for nearly ALL use cases, declaring and configuring properties listed here is sufficient. You should NOT have to explicitly massage a CAS XML/Java/etc configuration file to design an authentication handler, create attribute release policies, etc. CAS at runtime will auto-configure all required changes for you. If you are unsure about the meaning of a given CAS setting, do NOT turn it on without hesitation. Review the codebase or better yet, ask questions to clarify the intended behavior.

Naming Convention

Property names can be specified in very relaxed terms. For instance cas.someProperty, cas.some-property, cas.some_property are all valid names. While all forms are accepted by CAS, there are certain components (in CAS and other frameworks used) whose activation at runtime is conditional on a property value, where this property is required to have been specified in CAS configuration using kebab case. This is both true for properties that are owned by CAS as well as those that might be presented to the system via an external library or framework such as Spring Boot, etc.

:information_source: Note

When possible, properties should be stored in lower-case kebab format, such as cas.property-name=value. The only possible exception to this rule is when naming actuator endpoints; The name of the actuator endpoints (i.e. ssoSessions) MUST remain in camelCase mode.

Settings and properties that are controlled by the CAS platform directly always begin with the prefix cas. All other settings are controlled and provided to CAS via other underlying frameworks and may have their own schemas and syntax. BE CAREFUL with the distinction. Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends. This means if you somehow misspell a property definition or fail to adhere to the dot-notation syntax and such, your setting is entirely refused by CAS and likely the feature it controls will never be activated in the way you intend.

Validation

Configuration properties are automatically validated on CAS startup to report issues with configuration binding, especially if defined CAS settings cannot be recognized or validated by the configuration schema. Additional validation processes are also handled via Configuration Metadata and property migrations applied automatically on startup by Spring Boot and family.

Indexed Settings

CAS settings able to accept multiple values are typically documented with an index, such as cas.some.setting[0]=value. The index [0] is meant to be incremented by the adopter to allow for distinct multiple configuration blocks.

Subordinates

In OpenID Connect Federation, a subordinate is an entity that is “below” another federation entity in the trust hierarchy. Simply put, a subordinate is an entity whose federation metadata and trust relationship are vouched for by a higher-level entity in the federation.

More concretely, a subordinate is an entity for which a superior entity, such as a Trust Anchor or Intermediate Entity, can issue a Subordinate Statement. That statement is a signed Entity Statement saying, in effect:

“I, the issuer, make authoritative claims about this subject entity.”

The iss is the superior, and the sub is the subordinate.

1
2
3
4
Trust Anchor
  └── Intermediate Entity
        └── OpenID Provider
        └── Relying Party

For a trust anchor or intermediate, the supported subordinates must be defined as JSON files with the OidcFederationSubordinate format:

Relying Party Subordinate

Here is an example of an RP subordinate definition:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
  "entityId" : "http://rp",
  "metadata": {
    "openid_relying_party": {
      "redirect_uris": [
        "http://rp/callback"
      ],
      "application_type": "web",
      "response_types": [
        "code"
      ],
      "grant_types": [
        "authorization_code"
      ],
      "scope": "openid email profile",
      "token_endpoint_auth_method": "private_key_jwt",
      "token_endpoint_auth_signing_alg": "RS256",
      "request_object_signing_alg": "RS256",
      "jwks": {
        "keys": [
          {
            "kty": "RSA",
            "e": "AQAB",
            "use": "sig",
            "kid": "keyid",
            "n": "2moVQ...2aq7Q"
          }
        ]
      },
      "client_registration_types": [
        "explicit", "automatic"
      ],
      "client_name": "RP test"
    }
  },
  "federationKeys": [
    {
      "kty": "EC",
      "use": "sig",
      "crv": "P-256",
      "kid": "TJns",
      "x": "iLPMKMGqb7HeCnov5xBwEnq2zUbX5gNbyoVn1EHpvSI",
      "y": "1kcVTdS1_Y2_NnL0E9LpWhPWsoCNOFQR2Dd7VAJBYKY"
    }
  ]
}

OpenId Provider Subordinate

Here is an example of an OP subordinate definition:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
  "entityId" : "http://op",
  "metadata": {
    "openid_provider": {
      "authorization_endpoint": "http://op/login",
      "token_endpoint": "http://op/token",
      "registration_endpoint": "http://op/clients",
      "introspection_endpoint": "http://op/token/introspect",
      "revocation_endpoint": "http://op/token/revoke",
      "pushed_authorization_request_endpoint": "http://op/par",
      "federation_registration_endpoint": "http://op/federation/clients",
      "issuer": "http://op/oidc",
      "jwks_uri": "http://op/jwks.json",
      "scopes_supported": [
        "openid"
      ],
      "response_types_supported": [
        "code", "token", "id_token", "id_token token", 
        "code id_token", "code id_token token"
      ],
      "response_modes_supported": [
        "query", "fragment", "form_post", "query.jwt", 
        "fragment.jwt", "form_post.jwt", "jwt"
      ],
      "grant_types_supported": [
        "implicit", "authorization_code", "refresh_token", "password", 
        "client_credentials", "urn:ietf:params:oauth:grant-type:jwt-bearer"
      ],
      "code_challenge_methods_supported": [
        "plain", "S256"
      ],
      "token_endpoint_auth_methods_supported": [
        "client_secret_basic", "client_secret_post", 
        "client_secret_jwt", "private_key_jwt", "none"
      ],
      "token_endpoint_auth_signing_alg_values_supported": [
        "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", 
        "PS256", "PS384", "PS512", "ES256", "ES256K", "ES384", "ES512"
      ],
      
      ...TRUNCATED...
      
      "userinfo_encryption_enc_values_supported": [
        "A128CBC-HS256", "A192CBC-HS384", "A256CBC-HS512", 
        "A128GCM", "A192GCM", "A256GCM", "XC20P"
      ],
      "display_values_supported": [
        "page"
      ],
      "claim_types_supported": [
        "normal"
      ],
      "claims_supported": [
        "sub"
      ],
      "claims_parameter_supported": true,
      "frontchannel_logout_supported": true,
      "frontchannel_logout_session_supported": true,
      "backchannel_logout_supported": true,
      "backchannel_logout_session_supported": true
    }
  },
  "federationKeys": [
    {
      "kty": "RSA",
      "e": "AQAB",
      "use": "sig",
      "kid": "PRRz",
      "n": "vPZc7Y..."
    }
  ]
}

The metadata and federationKeys properties come both from the data in the .well-known/openid-federation endpoint. Both sections are mandatory in the federation entity definitions.

Signed entity statements are returned from the /oidc/fetch endpoint, depending on the requested subordinate (sub request parameter).