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.op; 019 020 021import java.net.URI; 022 023import net.jcip.annotations.Immutable; 024 025import com.nimbusds.oauth2.sdk.AbstractConfigurationRequest; 026import com.nimbusds.oauth2.sdk.WellKnownPathComposeStrategy; 027import com.nimbusds.oauth2.sdk.id.Issuer; 028 029 030/** 031 * OpenID Provider (OP) configuration request. 032 * 033 * <p>Example HTTP request: 034 * 035 * <pre> 036 * GET /.well-known/openid-configuration HTTP/1.1 037 * Host: example.com 038 * </pre> 039 * 040 * <p>Related specifications: 041 * 042 * <ul> 043 * <li>OpenID Connect Discovery 1.0, section 4.1. 044 * </ul> 045 */ 046@Immutable 047public class OIDCProviderConfigurationRequest extends AbstractConfigurationRequest { 048 049 050 /** 051 * The well-known path for OpenID Provider metadata. 052 */ 053 public static final String OPENID_PROVIDER_WELL_KNOWN_PATH = "/.well-known/openid-configuration"; 054 055 056 /** 057 * Creates a new OpenID Provider configuration request using the 058 * {@link WellKnownPathComposeStrategy#POSTFIX postfix well-known path 059 * composition strategy}. 060 * 061 * @param issuer The issuer. Must represent a valid URL. 062 */ 063 public OIDCProviderConfigurationRequest(final Issuer issuer) { 064 this(issuer, WellKnownPathComposeStrategy.POSTFIX); 065 } 066 067 068 /** 069 * Creates a new OpenID Provider configuration request. 070 * 071 * @param issuer The issuer. Must represent a valid URL. 072 * @param strategy The well-known path composition strategy. Must not 073 * be {@code null}. 074 * 075 */ 076 public OIDCProviderConfigurationRequest(final Issuer issuer, final WellKnownPathComposeStrategy strategy) { 077 super(URI.create(issuer.getValue()), OPENID_PROVIDER_WELL_KNOWN_PATH, strategy); 078 } 079}