Skip to content

Commit 73f3ca3

Browse files
address pr comments
1 parent 094838e commit 73f3ca3

File tree

8 files changed

+16
-17
lines changed

8 files changed

+16
-17
lines changed

components/org.wso2.carbon.identity.oauth.dcr/src/main/java/org/wso2/carbon/identity/oauth/dcr/service/DCRMService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,13 +619,12 @@ private OAuthConsumerAppDTO createOAuthApp(ApplicationRegistrationRequest regist
619619
oAuthConsumerApp.setPkceMandatory(registrationRequest.isExtPkceMandatory());
620620
oAuthConsumerApp.setPkceSupportPlain(registrationRequest.isExtPkceSupportPlain());
621621
oAuthConsumerApp.setBypassClientCredentials(registrationRequest.isExtPublicClient());
622-
623622
boolean enableFAPI = Boolean.parseBoolean(IdentityUtil.getProperty(OAuthConstants.ENABLE_FAPI));
624623
if (enableFAPI) {
625624
boolean enableFAPIDCR = Boolean.parseBoolean(IdentityUtil.getProperty(
626625
OAuthConstants.ENABLE_DCR_FAPI_ENFORCEMENT));
627626
if (enableFAPIDCR) {
628-
// Add FAPI conformant application nad isThirdParty property to the service provider.
627+
// Add FAPI conformant property to Oauth application.
629628
oAuthConsumerApp.setFAPIConformant(true);
630629
}
631630
}

components/org.wso2.carbon.identity.oauth.stub/src/main/resources/OAuthAdminService.wsdl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@
408408
<xs:element minOccurs="0" name="idTokenEncryptionMethod" nillable="true" type="xs:string"/>
409409
<xs:element minOccurs="0" name="idTokenExpiryTime" type="xs:long"/>
410410
<xs:element minOccurs="0" name="idTokenSignatureAlgorithm" nillable="true" type="xs:string"/>
411+
<xs:element minOccurs="0" name="isFAPIConformant" type="xs:boolean"/>
411412
<xs:element minOccurs="0" name="jwksURI" nillable="true" type="xs:string"/>
412413
<xs:element minOccurs="0" name="oauthConsumerKey" nillable="true" type="xs:string"/>
413414
<xs:element minOccurs="0" name="oauthConsumerSecret" nillable="true" type="xs:string"/>

components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/dao/OAuthAppDAO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ private void addServiceProviderOIDCProperties(Connection connection,
15371537
SUBJECT_TYPE, consumerAppDO.getSubjectType());
15381538

15391539
addToBatchForOIDCPropertyAdd(processedClientId, spTenantId, prepStmtAddOIDCProperty,
1540-
IS_FAPI_CONFORMANT_APP, consumerAppDO.getSubjectType());
1540+
IS_FAPI_CONFORMANT_APP, String.valueOf(consumerAppDO.isFAPIConformant()));
15411541

15421542
prepStmtAddOIDCProperty.executeBatch();
15431543
}

components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/dao/OAuthAppDO.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,12 @@ public void setRequestObjectEncryptionMethod(String requestObjectEncryptionMetho
463463
}
464464

465465
public boolean isFAPIConformant() {
466+
466467
return isFAPIConformant;
467468
}
468469

469470
public void setFAPIConformant(boolean fapiConformant) {
471+
470472
isFAPIConformant = fapiConformant;
471473
}
472474
}

components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/dto/OAuthConsumerAppDTO.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,14 @@ public void setIdTokenSignatureAlgorithm(String idTokenSignatureAlgorithm) {
429429

430430
this.idTokenSignatureAlgorithm = idTokenSignatureAlgorithm;
431431
}
432+
432433
public boolean isFAPIConformant() {
434+
433435
return isFAPIConformant;
434436
}
435437

436438
public void setFAPIConformant(boolean fapiConformant) {
439+
437440
isFAPIConformant = fapiConformant;
438441
}
439442
}

components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/util/OAuth2Util.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4948,7 +4948,7 @@ public static String resolveExternalConsentPageUrl(String tenantDomain) throws I
49484948
*
49494949
* @param clientId Client ID of the application.
49504950
* @return Whether the application should be FAPI conformant.
4951-
* @throws IdentityOAuth2Exception
4951+
* @throws IdentityOAuth2Exception InvalidOAuthClientException
49524952
*/
49534953
public static boolean isFapiConformantApp(String clientId)
49544954
throws IdentityOAuth2Exception, InvalidOAuthClientException {

components/org.wso2.carbon.identity.oauth/src/test/java/org/wso2/carbon/identity/oauth2/client/authentication/OAuthClientAuthnServiceTest.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,9 @@ public void testAuthenticateForFapiApplicationsWithInvalidAuthenticatorsRegister
197197
bodyParams.put(OAuth.OAUTH_CLIENT_ID, Arrays.asList(CLIENT_ID));
198198
PowerMockito.mockStatic(OAuth2Util.class);
199199
HttpServletRequest httpServletRequest = PowerMockito.mock(HttpServletRequest.class);
200-
/*ServiceProvider serviceProvider = new ServiceProvider();
201-
ServiceProviderProperty fapiAppSpProperty = new ServiceProviderProperty();
202-
fapiAppSpProperty.setName(OAuthConstants.IS_FAPI_CONFORMANT_APP);
203-
fapiAppSpProperty.setValue("true");
204-
serviceProvider.setSpProperties(new ServiceProviderProperty[]{fapiAppSpProperty});*/
205200
OAuthAppDO oAuthAppDO = new OAuthAppDO();
206201
oAuthAppDO.setTokenEndpointAuthMethod("private_key_jwt");
207202
oAuthAppDO.setFAPIConformant(true);
208-
//PowerMockito.when(OAuth2Util.getServiceProvider(Mockito.anyString())).thenReturn(serviceProvider);
209203
PowerMockito.when(OAuth2Util.getAppInformationByClientId(Mockito.anyString(), Mockito.anyString()))
210204
.thenReturn(oAuthAppDO);
211205
PowerMockito.when(OAuth2Util.isFapiConformantApp(Mockito.anyString())).thenReturn(true);
@@ -235,14 +229,9 @@ public void testAuthenticateWhenAuthMethodConfiguredInApp(boolean isFapiApp) thr
235229
bodyParams.put(OAuth.OAUTH_CLIENT_ID, Arrays.asList(CLIENT_ID));
236230
PowerMockito.mockStatic(OAuth2Util.class);
237231
HttpServletRequest httpServletRequest = PowerMockito.mock(HttpServletRequest.class);
238-
/*ServiceProvider serviceProvider = new ServiceProvider();
239-
ServiceProviderProperty fapiAppSpProperty = new ServiceProviderProperty();
240-
fapiAppSpProperty.setName(OAuthConstants.IS_FAPI_CONFORMANT_APP);
241-
fapiAppSpProperty.setValue(String.valueOf(isFapiApp));
242-
serviceProvider.setSpProperties(new ServiceProviderProperty[]{fapiAppSpProperty});*/
243232
OAuthAppDO oAuthAppDO = new OAuthAppDO();
244233
oAuthAppDO.setTokenEndpointAuthMethod("private_key_jwt");
245-
//PowerMockito.when(OAuth2Util.getServiceProvider(Mockito.anyString())).thenReturn(serviceProvider);
234+
oAuthAppDO.setFAPIConformant(isFapiApp);
246235
PowerMockito.when(OAuth2Util.getAppInformationByClientId(Mockito.anyString(), Mockito.anyString()))
247236
.thenReturn(oAuthAppDO);
248237
PowerMockito.when(OAuth2Util.isFapiConformantApp(Mockito.anyString())).thenReturn(true);

components/org.wso2.carbon.identity.oauth/src/test/java/org/wso2/carbon/identity/oauth2/util/OAuth2UtilTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@
118118
import static org.mockito.Matchers.anyBoolean;
119119
import static org.mockito.Matchers.anyInt;
120120
import static org.mockito.Matchers.anyString;
121-
import static org.powermock.api.mockito.PowerMockito.*;
121+
import static org.powermock.api.mockito.PowerMockito.doReturn;
122+
import static org.powermock.api.mockito.PowerMockito.mock;
123+
import static org.powermock.api.mockito.PowerMockito.mockStatic;
124+
import static org.powermock.api.mockito.PowerMockito.spy;
125+
import static org.powermock.api.mockito.PowerMockito.when;
126+
import static org.powermock.api.mockito.PowerMockito.whenNew;
122127
import static org.testng.Assert.assertEquals;
123128
import static org.testng.Assert.assertFalse;
124129
import static org.testng.Assert.assertNotNull;

0 commit comments

Comments
 (0)