0

I'm looking at how to implement authentication with WSO2 IS using an existing corporate webservice.

I have to modify the login to accept 3 parameters that are clientCODE, IDnumber, and password.

I am new to WSO2 IS and I started researching on the subject. So far I saw that if I need a custom federation authentication that connects to my webservice, will I need to make a local custom authenticator to work with the three parameters? What is the flow to be done?

EDIT: I created a custom federation authentication and can see the parameters sent by default webapp, I included there a rest client with org.apache.cxf.cxf-rt-rs-client but now I got a

org.apache.cxf.jaxrs.client.WebClient cannot be found by org.wso2.carbon.extension.identity.authenticator.custom_1.0.1

I included in my pom

<Import-Package>
                            org.apache.cxf.cxf-rt-rs-client;resolution:=optional,
                            org.apache.commons.logging.*; version="1.0.4",
                            org.osgi.framework,
                            org.wso2.carbon.identity.application.authentication.framework.*,
                            javax.servlet,
                            javax.servlet.http,
                            org.apache.oltu.oauth2.*; version="${oltu.package.import.version.range}", *;resolution:=optional,
                        </Import-Package>

I copied the jars to /repository/components/lib/ shows the same error.

Thanks

Community
  • 1
  • 1

1 Answers1

0

No, you can create a custom login page(simple webapp) and prompt it within your federated authenticator itself. Example: Instead of redirecting to an external URL, redirect it to your custom login web page from the initiateAuthenticationRequest method of your custom authenticator. Once the user submits the input, retrieve the inputs from a custom Servlet and send back to your cooperate service for authentication. Then your custom component(same servlet) will get the authentication response. Then you can provide the response to the WSO2's custom federated authenticator by calling the /commonauth endpoint from your custom webapp. Then that response will be processed by the custom federated authenticator's processAuthenticationResponse method do the authentication within WSO2.

In abstract, you just need a simple webapp to gather input and call the corporate service and get the response. Again, you need to write a custom federated authenticator to handle the /commonauth request forwarded by your webapplication. (Corporate service's response plus whatever the paramters that outgoing request has)

Hope this helps.

Nipun Thathsara
  • 1,119
  • 11
  • 20
  • Hello and thanks, I've followed your suggestion, I now reached the custom authenticator using default webapp I see credentials but now when I try to use a simple rest client to connect de cooperate service, I get the follow error javax.ws.rs.client.ClientBuilder cannot be found by org.wso2.carbon.extension.identity.authenticator.custom_2.2.1 I copied jars to /component/lib but no luck – Toto Galant May 14 '20 at 12:30
  • Your custom jar can't access the classes in `javax.ws.rs.client` package. You should import that package as an OSGI import in your pom's `maven-bundle-plugin`. – Nipun Thathsara May 14 '20 at 12:40
  • Attach the full `pom.xml` and `manifest.mf` created in side the JAR – Nipun Thathsara May 15 '20 at 12:17