1010final class ClientAssertion implements IClientAssertion {
1111
1212 static final String ASSERTION_TYPE_JWT_BEARER = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" ;
13- static final String ASSERTION_TYPE_JWT_POP = "urn:ietf:params:oauth:client-assertion-type:jwt-pop" ;
1413 private final String assertion ;
1514 private final Callable <String > assertionProvider ;
1615 private final Function <AssertionRequestOptions , String > contextAwareAssertionProvider ;
17- private final Function <AssertionRequestOptions , AssertionResponse > contextAwareResponseProvider ;
1816
1917 /**
2018 * Constructor that accepts a static assertion string
@@ -30,7 +28,6 @@ final class ClientAssertion implements IClientAssertion {
3028 this .assertion = assertion ;
3129 this .assertionProvider = null ;
3230 this .contextAwareAssertionProvider = null ;
33- this .contextAwareResponseProvider = null ;
3431 }
3532
3633 /**
@@ -47,7 +44,6 @@ final class ClientAssertion implements IClientAssertion {
4744 this .assertion = null ;
4845 this .assertionProvider = assertionProvider ;
4946 this .contextAwareAssertionProvider = null ;
50- this .contextAwareResponseProvider = null ;
5147 }
5248
5349 /**
@@ -66,27 +62,6 @@ final class ClientAssertion implements IClientAssertion {
6662 this .assertion = null ;
6763 this .assertionProvider = null ;
6864 this .contextAwareAssertionProvider = contextAwareAssertionProvider ;
69- this .contextAwareResponseProvider = null ;
70- }
71-
72- /**
73- * Constructor that accepts a context-aware function returning an {@link AssertionResponse}.
74- * This allows the callback to supply both the assertion JWT and an optional token-binding
75- * certificate for mTLS PoP scenarios.
76- *
77- * @param contextAwareResponseProvider A function that receives context and returns an AssertionResponse
78- * @throws NullPointerException if contextAwareResponseProvider is null
79- */
80- ClientAssertion (final Function <AssertionRequestOptions , AssertionResponse > contextAwareResponseProvider ,
81- boolean responseProvider ) {
82- if (contextAwareResponseProvider == null ) {
83- throw new NullPointerException ("contextAwareResponseProvider" );
84- }
85-
86- this .assertion = null ;
87- this .assertionProvider = null ;
88- this .contextAwareAssertionProvider = null ;
89- this .contextAwareResponseProvider = contextAwareResponseProvider ;
9065 }
9166
9267 /**
@@ -99,11 +74,6 @@ final class ClientAssertion implements IClientAssertion {
9974 * @throws MsalClientException if the assertion provider returns null/empty or throws an exception
10075 */
10176 public String assertion () {
102- if (contextAwareResponseProvider != null ) {
103- AssertionResponse response = assertionResponse (new AssertionRequestOptions (null , null , null ));
104- return response .assertion ();
105- }
106-
10777 if (contextAwareAssertionProvider != null ) {
10878 return assertion (new AssertionRequestOptions (null , null , null ));
10979 }
@@ -125,11 +95,6 @@ public String assertion() {
12595 * @throws MsalClientException if the assertion provider returns null/empty or throws an exception
12696 */
12797 String assertion (AssertionRequestOptions options ) {
128- if (contextAwareResponseProvider != null ) {
129- AssertionResponse response = assertionResponse (options );
130- return response .assertion ();
131- }
132-
13398 if (contextAwareAssertionProvider != null ) {
13499 try {
135100 String generatedAssertion = contextAwareAssertionProvider .apply (options );
@@ -153,40 +118,10 @@ String assertion(AssertionRequestOptions options) {
153118 }
154119
155120 /**
156- * Gets the full AssertionResponse from the context-aware response provider.
157- * Returns null if this ClientAssertion does not use a response provider.
158- *
159- * @param options context information for the assertion request
160- * @return An AssertionResponse, or null if not using a response provider
161- * @throws MsalClientException if the provider returns null or throws an exception
162- */
163- AssertionResponse assertionResponse (AssertionRequestOptions options ) {
164- if (contextAwareResponseProvider == null ) {
165- return null ;
166- }
167-
168- try {
169- AssertionResponse response = contextAwareResponseProvider .apply (options );
170-
171- if (response == null || StringHelper .isBlank (response .assertion ())) {
172- throw new MsalClientException (
173- "Assertion provider returned null or empty assertion" ,
174- AuthenticationErrorCode .INVALID_JWT );
175- }
176-
177- return response ;
178- } catch (MsalClientException ex ) {
179- throw ex ;
180- } catch (Exception ex ) {
181- throw new MsalClientException (ex );
182- }
183- }
184-
185- /**
186- * Returns true if this assertion uses a context-aware provider (either string or response).
121+ * Returns true if this assertion uses a context-aware provider.
187122 */
188123 boolean isContextAware () {
189- return contextAwareAssertionProvider != null || contextAwareResponseProvider != null ;
124+ return contextAwareAssertionProvider != null ;
190125 }
191126
192127 private String invokeCallable () {
@@ -216,11 +151,6 @@ public boolean equals(Object o) {
216151
217152 ClientAssertion other = (ClientAssertion ) o ;
218153
219- // For context-aware response providers, we consider them equal if they're the same object
220- if (this .contextAwareResponseProvider != null && other .contextAwareResponseProvider != null ) {
221- return this .contextAwareResponseProvider == other .contextAwareResponseProvider ;
222- }
223-
224154 // For context-aware providers, we consider them equal if they're the same object
225155 if (this .contextAwareAssertionProvider != null && other .contextAwareAssertionProvider != null ) {
226156 return this .contextAwareAssertionProvider == other .contextAwareAssertionProvider ;
@@ -237,11 +167,6 @@ public boolean equals(Object o) {
237167
238168 @ Override
239169 public int hashCode () {
240- // For context-aware response providers, use the provider's identity hash code
241- if (contextAwareResponseProvider != null ) {
242- return System .identityHashCode (contextAwareResponseProvider );
243- }
244-
245170 // For context-aware providers, use the provider's identity hash code
246171 if (contextAwareAssertionProvider != null ) {
247172 return System .identityHashCode (contextAwareAssertionProvider );
0 commit comments