Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Localtabgroup
Localtab
activetrue
titleFirst Steps

Add an import statement to conf/credentials.xml:

Code Block
<!-- OIDC extension default credential definitions -->
<import resource="oidc-credentials.xml" />

Adjust or add the idp.searchForProperties setting in idp.properties and set it to true to auto-locate and load the new properties file. This will extend to other new features in the future, so makes adding and removing new functionality simpler.

If you want to leverage the new default claim mapping rules, you can add an import to conf/attributes/default-rules.xml:

Code Block
<import resource="oidc-claim-rules.xml" />

The impact of this is to reduce the need for <AttributeDefinition> and <AttributeEncoder> elements in your Attribute Resolver configuration when adhering to "default" expectations for the names of attributes and how they map into OIDC claims. We encourage this as it makes things simpler and more consistent but it isn't mandatory.

The additional files created in conf/examples (oidc-attribute-resolver.xml and oidc-attribute-filter.xml) are intended as a source of examples to copy into your own files. The most critical definitions needed are the rules for creating and releasing the "sub" claim, as that as a required OIDC feature (see ClaimSetup). If you want to use them directly (unlikely), you can copy them elsewhere and make us of them as you see fit.

Localtab
idKeyGeneration
titleKey Generation

The OP plugin relies on keys in the JWK format. There is no advantage to reusing any existing keys your IdP may be using.

The default configuration expects to have two RSA keys (one for signing and one for decryption), and one EC key. They are expected to be in locations defined via the following properties (with the shipping defaults shown):

  • idp.signing.oidc.rs.key - %{idp.home}/credentials/idp-signing-rs.jwk
  • idp.signing.oidc.es.key -%{idp.home}/credentials/idp-signing-es.jwk
  • idp.signing.oidc.rsa.enc.key - %{idp.home}/credentials/idp-encryption-rsa.jwk

Keys may be generated using the provided wrapper in bin/jwtgen.sh and bin/jwtgen.bat:

Code Block
languagebash
titleKey Generation Example
collapsetrue
$ cd /opt/shibboleth-idp
$ bin/jwtgen.sh -t RSA -s 2048 -u sig -i defaultRSASign | tail -n +2 > credentials/idp-signing-rs.jwk
$ bin/jwtgen.sh	-t EC -c P-256 -u sig -i defaultECSign | tail -n +2 > credentials/idp-signing-es.jwk
$ bin/jwtgen.sh	-t RSA -s 2048 -u enc -i defaultRSAEnc | tail -n +2 > credentials/idp-encryption-rsa.jwk
Localtab
titleOIDC Issuer and Discovery

The OIDC "issuer" value needs to be determined, and the OpenID discovery document needs to be made accessiible.

The issuer value is set in conf/oidc.properties and must be a URL using the "https" scheme that contains host, and optionally, port number and path components and no query or fragment components. It must resolve to the deployment in question. As a result, while it may be the same as one's SAML entityID, it often cannot be, as SAML does not conflate identity and location in this fashion.

Code Block
titleconf/oidc.properties
idp.oidc.issuer = https://your.issuer.example.org

A common way for RPs to configure themselves against an OP is to read the openid-configuration resource as defined in https://openid.net/specs/openid-connect-discovery-1_0.html. A template for this file is created in static/openid-configuration

You will need to update it to match your configuration. At minimum this means replacing "{{ service_name }}" with the host portion of your issuer value.

For the RP to locate the file you will either have to:

  • Configure your Java container or other web server "front-end" to publish it at this exact location (obviously the prefix depends on your issuer value):

https://your.issuer.example.org/.well-known/openid-configuration

  • Or (more typically), configure that location to route into your IdP at "/idp/profile/oidc/discovery" to generate the document more dynamically.

The OPDiscovery topic describes this further.

Localtab
titleEnabling Profiles

Activating support for OIDC, as with other protocols supported, requires adjusting the RelyingPartyConfiguration in conf/relying-party.xml.

One of the profiles (the one that advertises keys) needs to be openly accessible:

Code Block
languagexml
titleconf/relying-party.xml
<bean id="shibboleth.UnverifiedRelyingParty" parent="RelyingParty">
	<property name="profileConfigurations">
		<list>
			<ref bean="OIDC.Keyset" />
		</list>
	</property>
</bean>

The rest are functional profiles that may be enabled more selectively but would normally be enabled by default:

Code Block
languagexml
titleconf/relying-party.xml
<bean id="shibboleth.DefaultRelyingParty" parent="RelyingParty">
	<property name="profileConfigurations">
		<list>
			<ref bean="OIDC.SSO" />
			<ref bean="OIDC.UserInfo"/>
			<ref bean="OAUTH2.Revocation"/>
			<ref bean="OAUTH2.Introspection" />
		</list>
	</property>
</bean>

Obviously this relies on a lot of defaulted behavior, but the documentation "proper" includes more detailed information about how to adjust profile settings.

Localtab
idClaimSetup
titleClaim Setup

Attributes in OIDC are termed claims, but the IdP treats them just as in other protocols, with the usual resolution and filtering approaches. You will need to reference that documentation early on in the testing process and you will also want to take some care regarding the "sub" claim.

Localtab
titleExample RP

For initial testing, it's helpful to start simple and add an example RP by hand. There are several different ways of managing RP registration data, but for a quick test, the simplest is to add some static JSON to the system to define a test system.

There are some commented options in conf/oidc-clientinfo-resolvers.xml that can be uncommented to supply an example JSON file to load:

Code Block
languagexml
titleconf/oidc-clientinfo-resolvers.xml
    <util:list id="shibboleth.oidc.ClientInformationResolvers">
		<!-- Uncommented -->
        <ref bean="ExampleFileResolver" />

        <ref bean="ExampleStorageClientInformationResolver" />
    </util:list>

    <!-- Uncommented -->
    <bean id="ExampleFileResolver" parent="shibboleth.oidc.FilesystemClientInformationResolver"
        c:metadata="%{idp.home}/metadata/oidc-client.json" />

This in turn allows you to statically define a JSON array of client registrations in a file:

Code Block
languagejs
titlemetadata/oidc-client.json
[
  {
    "scope":"openid email",
    "redirect_uris":["https://demorp.example.org/redirect_uri"],
    "client_id":"demo_rp",
    "client_secret":"topsecret",
    "response_types":["code"],
    "grant_types":["authorization_code"]
  }
]

You will of course need to adjust the JSON to match the client you are testing, for which the documentation should help.

...