mule 3.7 gmail connector config-with-oauth issues - oauth

I am trying to create gmail integration using the new gmail connector using config-with-oauth. I added appropriate dependencies in pom.xml, still it is failing to find the mule-gmail xsd.
mule config xml >mule xml
Pom > pom.xml
This is the > error

You need to add the connector as an inclusion on the mule maven plugin
:
<inclusion>
<groupId>org.mule.module</groupId>
<artifactId>mule-module-gmail</artifactId>
</inclusion>
And then you also need to add the oauth-callback-config
<gmail:config-with-oauth name="GMail_Connector"
consumerKey="xxx" consumerSecret="xxx" doc:name="GMail Connector">
<gmail:oauth-callback-config></gmail:oauth-callback-config>
</gmail:config-with-oauth>

Related

Is there a way to convert thrift IDL into wsdl spec?

Is there any open source library or online service that could automagicaly generate wsdl spec on the base of the thrift IDL?
The goal is to build facade API on the top of existing thrift API that would allow coupling with ansient systems via SOAP protocol.
There are a couple of ready to use tools that allow to convert Thrift IDL into WSDL. The rest of the answer assumes we live in the Java world with JDK and Maven at hand and internet connection available.
The first one is Swift Code Generator Tool. As it's readme states, one have to:
download the latest version:
mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:get -DremoteRepositories=central::default::http://repo1.maven.apache.org/maven2 -Dartifact=com.facebook.swift:swift-generator-cli:RELEASE:jar:standalone -Ddest=/tmp/
run downloaded jar in the directory containing thrift files:
java -jar /tmp/swift-generator-cli-0.23.1-standalone.jar -use_java_namespace -out ../java *.thrift
assuming standard
- src
- main
- java
- thrift
Maven project layout. Swift Code Generator will generate a Java interface for each Thrift service entry. Every Thrift source file must declare a 'java' namespace, like this:
namespace java com.acme
The generated interface will include nested Async interface for asynchronous invocation. Remove Async subinterface. Automation of Async removal is left as an exercise for the reader.
Compile generated java files with javac or your favourite build tool (ant, maven, gradle, etc.). Do not forget to include com.facebook.swift:swift-annotations:0.23.1 as a compile dependency.
Finally use Apache Axis2' java2wsdl utility available within Axis2 binary distribution, like this:
/tmp/axis2-1.7.4/bin/java2wsdl.sh -cn com.acme.TargetService -cp build/classes/main
to generate wsdl for the Thrift service TargetService {...} entry.

Magnolia EE license auto deploy

I am trying to build an automatic deploy system for Magnolia 5.4 EE. For this, I exported the license config node /config/modules/enterprise/license to a file config.modules.enterprise.license.xml and attached this to the mgnl-bootstrap/my-module-directory of my module.
In this bootstrap-directory, other xml configuration files are present and are entered as expected into the configuration database. However, after deploy Magnolia still asks me to enter the license key - everything else works fine, my product is deployed, etc.
I tried to find information in the Magnolia documentation, but to no avail. Anyone here who was able to automatically deploy a Magnolia EE?
It should work if you add a dependency to enterprise magnolia module in your my-module descriptor file. This way the enterprise module will be installed before your module, and you just add a new node to its config.
Another option is to add the license import file to WEB-INF/bootstrap/common, the difference here is that everything in that folder gets bootstrapped after all modules are started.

Keycloak Unknown authentication mechanism

I need help with using keycloak in an Errai app. I am getting an error about "unknown authentication method" for "KEYCLOAK" ? I have the keycloak-appliance running (on a different port though), and the Errai app has a with KEYCLOAK in the web.xml file inside WEB-INF
When I run the Errai app with mvn gwt:run, I get : RuntimeException caused by "Unknown authentication mechanism KEYCLOAK". I have no idea how to go around this issue .
Just wanted to add a little more detail to #cfsnyder's answer. In order for your application server to recognize a definition in the web.xml that looks like this:
<login-config>
<auth-method>KEYCLOAK</auth-method>
<realm-name>internal</realm-name>
</login-config>
you'll need to tell jboss (in this instance) how to interpret that particular auth method. At the time of my answer, this is in section 8.2 of the Keycloak docs.
First, download the keycloak adapter (remember, this is not the same as the Keycloak Server). Next, unzip the download in the wildfly home directory. With your application server running, just use the following command to install the Keycloak configuration into the appropriate files:
jboss-cli.sh -c --file=adapter-install.cli
When this script completes, your configuration file will have the new entry added to accommodate the KEYCLOAK entry in your web.xml. The script will add something like this to either a domain.xml or standalone.xml:
<security-domain name="keycloak">
<authentication>
<login-module code="org.keycloak.adapters.jboss.KeycloakLoginModule" flag="required"/>
</authentication>
</security-domain>
Once you have the Keycloak module files provided by the adapter + the security domain configuration to link the KEYCLOAK method to the appropriate LoginModule, you should be all set.
You will need to install and configure the Wildfly adapter in order for your Errai app to recognize the "KEYCLOAK" authentication method. See section 7.2 of the Keycloak documentation.
To add to #josh-cain's answer, you might also need following additions in your domain.xml or standalone.xml:
To <extensions></extensions>, add:
<extension module="org.keycloak.keycloak-adapter-subsystem"/>
To <profile></profile>, add:
<subsystem xmlns="urn:jboss:domain:keycloak:1.1"/>
The adapter installation cli scripts can fail for various reasons so you might need to add these entries manually.

Grails - transport guarantee confidential

So, I have founded a blog showing that in order to configure transport-guarantee confidential in a grails application I have to first install template executing:
grails install-templates
Really? It does not exist a configuration that I can do on grails classes and/or config files to accomplish that? This command install a lot more files than I need...
The blog url:
http://www.intelligrape.com/blog/2012/06/29/how-to-configure-ssl-on-tomcat-server-and-run-grailsjava-application-on-https/

WSO2 ESB Using AuthenticationAdmin

I have a NetBeans Project and tried to creat an Web Service client with the following WSDL from WSO2 ESB 4.6.0 like in this example:
https://localhost:9443/services/AuthenticationAdmin?wsdl
But when NetBeans tries to create the client I get an error:
Why is this happening? I created other Web Service Clients, they are working, but this isn't working and I don't know why...
If I try it with eclipse I also get an error:
IWAB0399E Error in generating Java from WSDL: java.io.IOException: ERROR: Missing <soap:fault> element inFault "AuthenticationAdminAuthenticationException" in operation "AuthenticationAdminAuthenticationException", in binding logout
java.io.IOException: ERROR: Missing <soap:fault> element inFault "AuthenticationAdminAuthenticationException" in operation "AuthenticationAdminAuthenticationException", in binding logout
at org.apache.axis.wsdl.symbolTable.SymbolTable.faultsFromSOAPFault(SymbolTable.java:2858)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populateBindings(SymbolTable.java:2549)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:744)
at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:543)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
at java.lang.Thread.run(Thread.java:722)
Maybe the WSDL has an error?
The AuthenticationAdmin WSDL file is correct.
The logout operation is defined as a "One-way" operation. If you look at AuthenticationAdmin.java implementation, you can see logout method has following signature.
public void logout() throws AuthenticationException
Note that the return type is "void", which means there is no output.
WSO2 uses Apache Axis2 and there are no problems generating the client with Axis2.
I just tried creating a client with Eclipse & Apache Axis2. I could successfully create the stub.
WSO2 also uses the Service Stub created using AuthenticationAdmin WSDL. See pom.xml for more information about generating the client.
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<arg line="-uri src/main/resources/AuthenticationAdmin.wsdl
-u -uw -o target/generated-code
-ns2p http://common.core.carbon.wso2.org/xsd=org.wso2.carbon.authenticator.stub.authentication,http://authentication.services.core.carbon.wso2.org=org.wso2.carbon.authenticator.stub,http://authentication.services.core.carbon.wso2.org/xsd=org.wso2.carbon.authenticator.stub"/>
<classpath refid="wsdl2java.classpath"/>
</java>
I'm getting the same error as you have shown, when I try to generate the client using Apache Axis. Therefore please make sure to use Apache Axis2 as the web service runtime. Also make sure you point Axis2 directory in Eclipse Preferences -> Web Services -> Axis2 Preferences.
I also see NetBeans try to use wsimport utility. May be it doesn't support one-way operations properly.
I recommend you to use Apache Axis2 to generate the client.

Resources