0
votes

1) What we want:

We want Carbon (WSO2 API-Manager 3.0) to be proxied by Nginx through and after its interactions with our IAM login process.

2) what we did:

We reverse proxy to the initial page at our_proxy/wso2 and clients had no mention of the wso2_host machine.

We followed instruction from "Configuring the Proxy Server and the Load Balancer" to setup the reverse proxy.

https://apim.docs.wso2.com/en/latest/install-and-setup/setup/setting-up-proxy-server-and-the-load-balancer/configuring-the-proxy-server-and-the-load-balancer/#step-2-configure-the-load-balancerreverse-proxy-server

These are the settings we used in Step 3, "Configure the reverse proxy settings in the product":

[transport.https.properties]
proxyPort = 443
[server]
hostname = "our-api-store-url"

inside the file <API-M_HOME>/repository/conf/deployment.toml.

3) What we got:

During the authentication process, clients were redirected to Carbon on wso2_host:port and remained there after receiving their authentication token, so subsequent work was not proxied.

This is a problem because we cannot manage the URL appearance of our gateway or expose it without revealing wso2_host and requiring application port openings.

This is the corresponding error message from the log files:

api-manager_1             | JAVA_HOME environment variable is set to /opt/java/o                           penjdk
api-manager_1             | CARBON_HOME environment variable is set to /home/wso                           2carbon/wso2am-3.0.0
api-manager_1             | Using Java memory options: -Xms256m -Xmx1024m
api-manager_1             | [2020-05-07 10:52:41,478]  INFO {org.wso2.config.map                           per.ConfigParser} - Applying Configurations upon new Templates
api-manager_1             | [2020-05-07 10:52:41,483]  WARN {org.wso2.config.map                           per.ConfigParser} - Overriding files in configuration directory /home/wso2carbon                           /wso2am-3.0.0
api-manager_1             | [2020-05-07 10:52:41,730] ERROR {org.wso2.config.map                           per.TomlParser} - server previously defined at line 1, column 1 (line 237, colum                           n 1)
api-manager_1             | [2020-05-07 10:52:41,732]  SEVERE {org.wso2.carbon.s                           erver.Main handleConfiguration} - Error while performing configuration changes
api-manager_1             | org.wso2.config.mapper.ConfigParserException: Error                            parsing deployment configuration
api-manager_1             |     at org.wso2.config.mapper.TomlParser.parse(TomlP                           arser.java:140)
api-manager_1             |     at org.wso2.config.mapper.ConfigParser.parse(Con                           figParser.java:249)
api-manager_1             |     at org.wso2.config.mapper.ConfigParser.deploy(Co                           nfigParser.java:217)
api-manager_1             |     at org.wso2.config.mapper.ConfigParser.deployAnd                           StoreMetadata(ConfigParser.java:180)
api-manager_1             |     at org.wso2.config.mapper.ConfigParser.parse(Con                           figParser.java:127)
api-manager_1             |     at org.wso2.carbon.server.Main.handleConfigurati                           on(Main.java:231)
api-manager_1             |     at org.wso2.carbon.server.Main.main(Main.java:10                           3)
api-manager_1             |     at sun.reflect.NativeMethodAccessorImpl.invoke0(                           Native Method)
api-manager_1             |     at sun.reflect.NativeMethodAccessorImpl.invoke(N                           ativeMethodAccessorImpl.java:62)
api-manager_1             |     at sun.reflect.DelegatingMethodAccessorImpl.invo                           ke(DelegatingMethodAccessorImpl.java:43)
api-manager_1             |     at java.lang.reflect.Method.invoke(Method.java:4                           98)
api-manager_1             |     at org.wso2.carbon.bootstrap.Bootstrap.loadClass                           (Bootstrap.java:70)
api-manager_1             |     at org.wso2.carbon.bootstrap.Bootstrap.main(Boot                           strap.java:51)
api-manager_1             |
apim-with-analytics_api-manager_1 exited with code 0
api-manager_1             | [2020-05-07 10:52:41,732]  SEVERE {org.wso2.carbon.s                           erver.Main handleConfiguration} - Error while performing configuration changes
api-manager_1             | org.wso2.config.mapper.ConfigParserException: Error                            parsing deployment configuration
api-manager_1             |     at org.wso2.config.mapper.TomlParser.parse(TomlP                           arser.java:140)
api-manager_1             |     at org.wso2.config.mapper.ConfigParser.parse(Con                           figParser.java:249)
api-manager_1             |     at org.wso2.config.mapper.ConfigParser.deploy(Co                           nfigParser.java:217)
api-manager_1             |     at org.wso2.config.mapper.ConfigParser.deployAnd                           StoreMetadata(ConfigParser.java:180)
api-manager_1             |     at org.wso2.config.mapper.ConfigParser.parse(Con                           figParser.java:127)
api-manager_1             |     at org.wso2.carbon.server.Main.handleConfigurati                           on(Main.java:231)
api-manager_1             |     at org.wso2.carbon.server.Main.main(Main.java:10                           3)
api-manager_1             |     at sun.reflect.NativeMethodAccessorImpl.invoke0(                           Native Method)
api-manager_1             |     at sun.reflect.NativeMethodAccessorImpl.invoke(N                           ativeMethodAccessorImpl.java:62)
api-manager_1             |     at sun.reflect.DelegatingMethodAccessorImpl.invo                           ke(DelegatingMethodAccessorImpl.java:43)
api-manager_1             |     at java.lang.reflect.Method.invoke(Method.java:4                           98)
api-manager_1             |     at org.wso2.carbon.bootstrap.Bootstrap.loadClass                           (Bootstrap.java:70)
api-manager_1             |     at org.wso2.carbon.bootstrap.Bootstrap.main(Boot                           strap.java:51)
api-manager_1             |
apim-with-analytics_api-manager_1 exited with code 0
api-manager_1             | JAVA_HOME environment variable is set to /opt/java/o                           penjdk
api-manager_1             | CARBON_HOME environment variable is set to /home/wso                           2carbon/wso2am-3.0.0
api-manager_1             | Using Java memory options: -Xms256m -Xmx1024m
api-manager_1             | [2020-05-07 10:52:41,478]  INFO {org.wso2.config.map                           per.ConfigParser} - Applying Configurations upon new Templates
api-manager_1             | [2020-05-07 10:52:41,483]  WARN {org.wso2.config.map                           per.ConfigParser} - Overriding files in configuration directory /home/wso2carbon                           /wso2am-3.0.0
api-manager_1             | [2020-05-07 10:52:41,730] ERROR {org.wso2.config.map                           per.TomlParser} - server previously defined at line 1, column 1 (line 237, colum                           n 1)
api-manager_1             | [2020-05-07 10:52:41,732]  SEVERE {org.wso2.carbon.s                           erver.Main handleConfiguration} - Error while performing configuration changes
api-manager_1             | org.wso2.config.mapper.ConfigParserException: Error                            parsing deployment configuration
api-manager_1             |     at org.wso2.config.mapper.TomlParser.parse(TomlP                           arser.java:140)
api-manager_1             |     at org.wso2.config.mapper.ConfigParser.parse(Con                           figParser.java:249)
api-manager_1             |     at org.wso2.config.mapper.ConfigParser.deploy(Co                           nfigParser.java:217)
api-manager_1             |     at org.wso2.config.mapper.ConfigParser.deployAnd                           StoreMetadata(ConfigParser.java:180)
api-manager_1             |     at org.wso2.config.mapper.ConfigParser.parse(Con                           figParser.java:127)
api-manager_1             |     at org.wso2.carbon.server.Main.handleConfigurati                           on(Main.java:231

Any ideas on what we can change to fix the problem?

1
Based on the error logs, you have a config issue in deployment.toml. The toml file cannot be passed due to invalid configs. - Pubci

1 Answers

0
votes

We solved the problem by following the steps in "Troubleshooting 'Registered callback does not match with the provided url' error" in the API Manager Documentation.

https://apim.docs.wso2.com/en/latest/troubleshooting/troubleshooting-invalid-callback-error/

enter image description here

In addition, we had our Identity Provider (IDP/IAM) team update the settings with the same callback to carbon which then calls to the webapp of store and publisher.