use of org.wso2.carbon.identity.api.server.application.management.v1.AuthProtocolMetadata in project product-is by wso2.
the class ApplicationMetadataPositiveTest method init.
@BeforeClass(alwaysRun = true)
public void init() throws IOException {
super.testInit(API_VERSION, swaggerDefinition, tenant);
// Init getAllEmailTemplateTypes method response
ObjectMapper jsonWriter = new ObjectMapper(new JsonFactory());
String expectedResponse = readResource("all-inbound-protocols-response.json");
allInboundProtocolsResponse = Arrays.asList(jsonWriter.readValue(expectedResponse, AuthProtocolMetadata[].class));
// Init OIDC Metadata
expectedResponse = readResource("oidc-metadata.json");
oidcMetaData = jsonWriter.readValue(expectedResponse, OIDCMetaData.class);
// Init SAML Metadata
expectedResponse = readResource("saml-metadata-super-tenant.json");
samlMetaDataSuperTenant = jsonWriter.readValue(expectedResponse, SAMLMetaData.class);
expectedResponse = readResource("saml-metadata-tenant.json");
samlMetaDataTenant = jsonWriter.readValue(expectedResponse, SAMLMetaData.class);
// Init WS Trust Metadata
expectedResponse = readResource("ws-trust-metadata-super-tenant.json");
wsTrustMetaDataSuperTenant = jsonWriter.readValue(expectedResponse, WSTrustMetaData.class);
expectedResponse = readResource("ws-trust-metadata-tenant.json");
wsTrustMetaDataTenant = jsonWriter.readValue(expectedResponse, WSTrustMetaData.class);
}
use of org.wso2.carbon.identity.api.server.application.management.v1.AuthProtocolMetadata in project product-is by wso2.
the class ApplicationMetadataPositiveTest method testGetAllInboundProtocols.
@Test
public void testGetAllInboundProtocols() throws IOException {
Response response = getResponseOfGet(METADATA_API_BASE_PATH + PATH_SEPARATOR + INBOUND_PROTOCOLS_PATH);
response.then().log().ifValidationFails().assertThat().statusCode(HttpStatus.SC_OK);
ObjectMapper jsonWriter = new ObjectMapper(new JsonFactory());
List<AuthProtocolMetadata> responseFound = Arrays.asList(jsonWriter.readValue(response.asString(), AuthProtocolMetadata[].class));
Assert.assertEquals(responseFound, allInboundProtocolsResponse, "Response of the get all inbound protocols doesn't match.");
}
use of org.wso2.carbon.identity.api.server.application.management.v1.AuthProtocolMetadata in project identity-api-server by wso2.
the class ServerApplicationMetadataService method getInboundProtocols.
/**
* Return a list of all available inbound protocols. If the customOnly parameter set to True, will return only the
* custom protocols.
*
* @param customOnly Set to True to get only custom protocols. Default value: False.
* @return The list of inbound protocols.
*/
public List<AuthProtocolMetadata> getInboundProtocols(Boolean customOnly) {
List<AuthProtocolMetadata> authProtocolMetadataList = new ArrayList<>();
// Add custom inbound protocols
Map<String, AbstractInboundAuthenticatorConfig> allCustomAuthenticators = ApplicationManagementServiceHolder.getApplicationManagementService().getAllInboundAuthenticatorConfig();
for (Map.Entry<String, AbstractInboundAuthenticatorConfig> entry : allCustomAuthenticators.entrySet()) {
AuthProtocolMetadata protocol = new AuthProtocolMetadata().name(entry.getValue().getName()).displayName(entry.getValue().getFriendlyName());
authProtocolMetadataList.add(protocol);
}
if (customOnly == null || !customOnly) {
// Add default inbound protocols. WS-Federation (Passive) is not added because it doesn't have metadata,
authProtocolMetadataList.add(new AuthProtocolMetadata().name("saml").displayName("SAML2 Web SSO Configuration"));
authProtocolMetadataList.add(new AuthProtocolMetadata().name("oidc").displayName("OAuth/OpenID Connect Configuration"));
authProtocolMetadataList.add(new AuthProtocolMetadata().name("ws-trust").displayName("WS-Trust Security Token Service Configuration"));
}
return authProtocolMetadataList;
}
Aggregations