001/*
002 * oauth2-oidc-sdk
003 *
004 * Copyright 2012-2016, Connect2id Ltd and contributors.
005 *
006 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use
007 * this file except in compliance with the License. You may obtain a copy of the
008 * License at
009 *
010 *    http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software distributed
013 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
014 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
015 * specific language governing permissions and limitations under the License.
016 */
017
018package com.nimbusds.openid.connect.sdk.federation.config;
019
020
021import net.jcip.annotations.Immutable;
022
023import com.nimbusds.oauth2.sdk.AbstractConfigurationRequest;
024import com.nimbusds.oauth2.sdk.WellKnownPathComposeStrategy;
025import com.nimbusds.openid.connect.sdk.federation.entities.EntityID;
026
027
028/**
029 * Federation entity configuration request.
030 *
031 * <p>Example HTTP request:
032 *
033 * <pre>
034 * GET /.well-known/openid-federation HTTP/1.1
035 * Host: example.com
036 * </pre>
037 *
038 * <p>Related specifications:
039 *
040 * <ul>
041 *     <li>OpenID Connect Federation 1.0, section 6.1.
042 * </ul>
043 */
044@Immutable
045public class FederationEntityConfigurationRequest extends AbstractConfigurationRequest {
046        
047        
048        /**
049         * The well-known path for federation entity metadata.
050         */
051        public static final String OPENID_FEDERATION_ENTITY_WELL_KNOWN_PATH = "/.well-known/openid-federation";
052        
053        
054        /**
055         * Creates a new federation entity configuration request using the
056         * {@link WellKnownPathComposeStrategy#POSTFIX postfix well-known path
057         * composition strategy}.
058         *
059         * @param entityID The entity ID. Must represent a valid URL. Must not
060         *                 be {@code null}.
061         */
062        public FederationEntityConfigurationRequest(final EntityID entityID) {
063                this(entityID, WellKnownPathComposeStrategy.POSTFIX);
064        }
065        
066        
067        /**
068         * Creates a new federation entity configuration request.
069         *
070         * @param entityID The entity ID. Must represent a valid URL. Must not
071         *                 be {@code null}.
072         * @param strategy The well-known path composition strategy. Must not
073         *                 be {@code null}.
074         */
075        public FederationEntityConfigurationRequest(final EntityID entityID, final WellKnownPathComposeStrategy strategy) {
076                super(entityID.toURI(), OPENID_FEDERATION_ENTITY_WELL_KNOWN_PATH, strategy);
077        }
078}