2 * Copyright 2001-2007 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file shibsp/handler/SessionInitiator.h
20 * Pluggable runtime functionality that handles initiating sessions.
23 #ifndef __shibsp_initiator_h__
24 #define __shibsp_initiator_h__
26 #include <shibsp/handler/Handler.h>
31 * Pluggable runtime functionality that handles initiating sessions.
33 * <p>By default, SessionInitiators look for an entityID on the incoming request
34 * and pass control to the specialized run method.
36 class SHIBSP_API SessionInitiator : public virtual Handler
42 virtual ~SessionInitiator() {}
45 * Executes an incoming request.
47 * <p>SessionInitiators can be run either directly by incoming web requests
48 * or indirectly/implicitly during other SP processing.
50 * @param request SP request context
51 * @param entityID the name of an IdP to request a session from, if known
52 * @param isHandler true iff executing in the context of a direct handler invocation
53 * @return a pair containing a "request completed" indicator and a server-specific response code
55 virtual std::pair<bool,long> run(SPRequest& request, std::string& entityID, bool isHandler=true) const=0;
57 std::pair<bool,long> run(SPRequest& request, bool isHandler=true) const;
60 const char* getType() const {
61 return "SessionInitiator";
66 /** Registers SessionInitiator implementations. */
67 void SHIBSP_API registerSessionInitiators();
69 /** SessionInitiator that iterates through a set of protocol-specific versions. */
70 #define CHAINING_SESSION_INITIATOR "Chaining"
72 /** SessionInitiator that supports SAML 2.0 AuthnRequests. */
73 #define SAML2_SESSION_INITIATOR "SAML2"
75 /** SessionInitiator that supports SAML Discovery Service protocol. */
76 #define SAMLDS_SESSION_INITIATOR "SAMLDS"
78 /** SessionInitiator that supports Shibboleth V1 AuthnRequest redirects. */
79 #define SHIB1_SESSION_INITIATOR "Shib1"
81 /** SessionInitiator that supports Shibboleth V1 WAYF redirects when no IdP is supplied. */
82 #define WAYF_SESSION_INITIATOR "WAYF"
84 /** SessionInitiator that attempts a sequence of transforms of an input until an entityID is found. */
85 #define TRANSFORM_SESSION_INITIATOR "Transform"
88 #endif /* __shibsp_initiator_h__ */