Search in sources :

Example 1 with CustomInboundProtocolMetaData

use of org.wso2.carbon.identity.api.server.application.management.v1.CustomInboundProtocolMetaData in project identity-api-server by wso2.

the class ServerApplicationMetadataService method getCustomProtocolMetadata.

/**
 * Pull property metadata of the custom inbound protocol that matches to the protocol name.
 *
 * @param inboundProtocolName URL encoded protocol name.
 * @return Populated CustomInboundProtocolMetaData object.
 */
public CustomInboundProtocolMetaData getCustomProtocolMetadata(String inboundProtocolName) {
    String protocolName = URLDecoder.decode(inboundProtocolName);
    Map<String, AbstractInboundAuthenticatorConfig> allCustomAuthenticators = ApplicationManagementServiceHolder.getApplicationManagementService().getAllInboundAuthenticatorConfig();
    // Loop through all custom inbound protocols and match the name.
    for (Map.Entry<String, AbstractInboundAuthenticatorConfig> entry : allCustomAuthenticators.entrySet()) {
        if (entry.getValue().getName().equals(protocolName)) {
            return new CustomInboundProtocolMetaData().displayName(entry.getValue().getFriendlyName()).configName(entry.getValue().getConfigName()).properties(getCustomInboundProtocolProperties(entry.getValue().getConfigurationProperties()));
        }
    }
    // Throw 404 error if the protocol not found
    throw handleInvalidInboundProtocol(inboundProtocolName);
}
Also used : CustomInboundProtocolMetaData(org.wso2.carbon.identity.api.server.application.management.v1.CustomInboundProtocolMetaData) AbstractInboundAuthenticatorConfig(org.wso2.carbon.identity.application.mgt.AbstractInboundAuthenticatorConfig) Map(java.util.Map)

Aggregations

Map (java.util.Map)1 CustomInboundProtocolMetaData (org.wso2.carbon.identity.api.server.application.management.v1.CustomInboundProtocolMetaData)1 AbstractInboundAuthenticatorConfig (org.wso2.carbon.identity.application.mgt.AbstractInboundAuthenticatorConfig)1