001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.juneau.rest.server.auth.saml;
018
019/**
020 * SAML 2.0 bindings supported by {@link SamlAuthFilter} for delivering a {@code <Response>} from an IdP to the SP.
021 *
022 * <p>
023 * v1 ships the two HTTP-flavored bindings.  Artifact and SOAP back-channel bindings are deferred.
024 *
025 * <h5 class='topic'>HTTP POST binding</h5>
026 * <p>
027 * The IdP returns an auto-submitting HTML form whose {@code SAMLResponse} field carries the base64-encoded
028 * {@code <Response>} document.  The browser POSTs the form to the SP's assertion-consumer URL.  This is the
029 * dominant binding for SAML 2.0 web SSO.
030 *
031 * <h5 class='topic'>HTTP Redirect binding</h5>
032 * <p>
033 * The IdP redirects the browser to the SP with the {@code SAMLResponse} carried in a query-string parameter.
034 * The value is deflated (RFC 1951) and then base64-encoded so that even mid-size assertions fit inside URL
035 * length limits.  This binding is more commonly used for {@code <AuthnRequest>} than for {@code <Response>},
036 * but some IdPs offer it for assertions too.
037 *
038 * <h5 class='section'>See Also:</h5>
039 * <ul>
040 *    <li class='jc'>{@link SamlAuthFilter}
041 *    <li class='link'><a class="doclink" href="https://docs.oasis-open.org/security/saml/v2.0/saml-bindings-2.0-os.pdf">SAML 2.0 Bindings (OASIS)</a>
042 * </ul>
043 *
044 * @since 10.0.0
045 */
046public enum SamlBinding {
047
048   /**
049    * HTTP POST binding.  {@code SAMLResponse} carried as a base64-encoded form field on a POST request.
050    */
051   POST,
052
053   /**
054    * HTTP Redirect binding.  {@code SAMLResponse} carried as a deflated + base64-encoded query parameter on a
055    * GET request.
056    */
057   REDIRECT
058}