@@ -23,9 +23,15 @@ public class AuthnRequestParams {
2323 private final String nameIdValueReq ;
2424
2525 /*
26- * / Selector to use to specify the Attribute Consuming Service index
26+ * Selector to use to specify the Assertion Consumer Service that will consume
27+ * the response
2728 */
28- private AttributeConsumingServiceSelector attributeConsumingServiceSelector ;
29+ private final AssertionConsumerServiceSelector assertionConsumerServiceSelector ;
30+
31+ /*
32+ * Selector to use to specify the Attribute Consuming Service index
33+ */
34+ private final AttributeConsumingServiceSelector attributeConsumingServiceSelector ;
2935
3036 /**
3137 * Create a set of authentication request input parameters. The
@@ -42,7 +48,7 @@ public class AuthnRequestParams {
4248 * whether a <code>NameIDPolicy</code> should be set
4349 */
4450 public AuthnRequestParams (boolean forceAuthn , boolean isPassive , boolean setNameIdPolicy ) {
45- this (forceAuthn , isPassive , setNameIdPolicy , null , null );
51+ this (forceAuthn , isPassive , setNameIdPolicy , null , null , null );
4652 }
4753
4854 /**
@@ -62,7 +68,28 @@ public AuthnRequestParams(boolean forceAuthn, boolean isPassive, boolean setName
6268 * the subject that should be authenticated
6369 */
6470 public AuthnRequestParams (boolean forceAuthn , boolean isPassive , boolean setNameIdPolicy , String nameIdValueReq ) {
65- this (forceAuthn , isPassive , setNameIdPolicy , nameIdValueReq , null );
71+ this (forceAuthn , isPassive , setNameIdPolicy , nameIdValueReq , null , null );
72+ }
73+
74+ /**
75+ * Create a set of authentication request input parameters.
76+ *
77+ * @param forceAuthn
78+ * whether the <code>ForceAuthn</code> attribute should be set to
79+ * <code>true</code>
80+ * @param isPassive
81+ * whether the <code>isPassive</code> attribute should be set to
82+ * <code>true</code>
83+ * @param setNameIdPolicy
84+ * whether a <code>NameIDPolicy</code> should be set
85+ * @param assertionConsumerServiceSelector
86+ * the selector to use to specify the Assertion Consumer Service
87+ * that will consume the response; if <code>null</code>,
88+ * {@link AssertionConsumerServiceSelector#useDefault()} is used
89+ */
90+ public AuthnRequestParams (boolean forceAuthn , boolean isPassive , boolean setNameIdPolicy ,
91+ AssertionConsumerServiceSelector assertionConsumerServiceSelector ) {
92+ this (forceAuthn , isPassive , setNameIdPolicy , null , assertionConsumerServiceSelector );
6693 }
6794
6895 /**
@@ -99,17 +126,71 @@ public AuthnRequestParams(boolean forceAuthn, boolean isPassive, boolean setName
99126 * whether a <code>NameIDPolicy</code> should be set
100127 * @param nameIdValueReq
101128 * the subject that should be authenticated
129+ * @param assertionConsumerServiceSelector
130+ * the selector to use to specify the Assertion Consumer Service
131+ * that will consume the response; if <code>null</code>,
132+ * {@link AssertionConsumerServiceSelector#useDefault()} is used
133+ */
134+ public AuthnRequestParams (boolean forceAuthn , boolean isPassive , boolean setNameIdPolicy , String nameIdValueReq ,
135+ AssertionConsumerServiceSelector assertionConsumerServiceSelector ) {
136+ this (forceAuthn , isPassive , setNameIdPolicy , nameIdValueReq , assertionConsumerServiceSelector , null );
137+ }
138+
139+ /**
140+ * Create a set of authentication request input parameters.
141+ *
142+ * @param forceAuthn
143+ * whether the <code>ForceAuthn</code> attribute should be set to
144+ * <code>true</code>
145+ * @param isPassive
146+ * whether the <code>isPassive</code> attribute should be set to
147+ * <code>true</code>
148+ * @param setNameIdPolicy
149+ * whether a <code>NameIDPolicy</code> should be set
150+ * @param nameIdValueReq
151+ * the subject that should be authenticated
152+ * @param attributeConsumingServiceSelector
153+ * the selector to use to specify the Attribute Consuming Service
154+ * index; if <code>null</code>,
155+ * {@link AttributeConsumingServiceSelector#useDefault()} is used
156+ */
157+ public AuthnRequestParams (boolean forceAuthn , boolean isPassive , boolean setNameIdPolicy , String nameIdValueReq ,
158+ AttributeConsumingServiceSelector attributeConsumingServiceSelector ) {
159+ this (forceAuthn , isPassive , setNameIdPolicy , nameIdValueReq , null , attributeConsumingServiceSelector );
160+ }
161+
162+ /**
163+ * Create a set of authentication request input parameters.
164+ *
165+ * @param forceAuthn
166+ * whether the <code>ForceAuthn</code> attribute should be set to
167+ * <code>true</code>
168+ * @param isPassive
169+ * whether the <code>isPassive</code> attribute should be set to
170+ * <code>true</code>
171+ * @param setNameIdPolicy
172+ * whether a <code>NameIDPolicy</code> should be set
173+ * @param nameIdValueReq
174+ * the subject that should be authenticated
175+ * @param assertionConsumerServiceSelector
176+ * the selector to use to specify the Assertion Consumer Service
177+ * that will consume the response; if <code>null</code>,
178+ * {@link AssertionConsumerServiceSelector#useDefault()} is used
102179 * @param attributeConsumingServiceSelector
103180 * the selector to use to specify the Attribute Consuming Service
104181 * index; if <code>null</code>,
105182 * {@link AttributeConsumingServiceSelector#useDefault()} is used
106183 */
107184 public AuthnRequestParams (boolean forceAuthn , boolean isPassive , boolean setNameIdPolicy , String nameIdValueReq ,
185+ AssertionConsumerServiceSelector assertionConsumerServiceSelector ,
108186 AttributeConsumingServiceSelector attributeConsumingServiceSelector ) {
109187 this .forceAuthn = forceAuthn ;
110188 this .isPassive = isPassive ;
111189 this .setNameIdPolicy = setNameIdPolicy ;
112190 this .nameIdValueReq = nameIdValueReq ;
191+ this .assertionConsumerServiceSelector = assertionConsumerServiceSelector != null
192+ ? assertionConsumerServiceSelector
193+ : AssertionConsumerServiceSelector .useDefault ();
113194 this .attributeConsumingServiceSelector = attributeConsumingServiceSelector != null
114195 ? attributeConsumingServiceSelector
115196 : AttributeConsumingServiceSelector .useDefault ();
@@ -127,6 +208,7 @@ protected AuthnRequestParams(AuthnRequestParams source) {
127208 this .isPassive = source .isPassive ();
128209 this .setNameIdPolicy = source .isSetNameIdPolicy ();
129210 this .nameIdValueReq = source .getNameIdValueReq ();
211+ this .assertionConsumerServiceSelector = source .getAssertionConsumerServiceSelector ();
130212 this .attributeConsumingServiceSelector = source .getAttributeConsumingServiceSelector ();
131213 }
132214
@@ -166,4 +248,12 @@ protected String getNameIdValueReq() {
166248 protected AttributeConsumingServiceSelector getAttributeConsumingServiceSelector () {
167249 return attributeConsumingServiceSelector ;
168250 }
251+
252+ /**
253+ * @return the selector to use to specify the Assertion Consumer Service that
254+ * will consume the response
255+ */
256+ protected AssertionConsumerServiceSelector getAssertionConsumerServiceSelector () {
257+ return assertionConsumerServiceSelector ;
258+ }
169259}
0 commit comments