1
votes

I'm trying to make a simple example of a connection to a WS (JAX-RS), when I call from the browser, I should return a string but I get the following error message:

missing_authorization, this is the URL to access the resource (REST): http://localhost:10080/PruebaWSProject/adapters/MyAdapter/users/pramirez

When I test it directly from MobileFirst Studio using "Call MobileFirst Adapter", it works perfectly.

It seems to be a problem with HTTP authentication, apparently I have to set something in the XML file server: authenticationConfig.xml, but I do not know what I have to put and I read the following in a web:

Disabling the authentication requirement for a specific procedure.
You can do so by adding the securityTest="wl_unprotected" property to the element in the adapter XML file.

I do not know how to turn off the security to call the resource to obtain the chain. The name of the classes generated by the Java adapter are: MyAdapterResource and MyAdapterApplication.

1
Solved, thank you very muchEladerezador

1 Answers

3
votes

Java Adapters are protected by default.

When you use "Call MobileFirst Adapter", a test token is automatically added to help you preview.

If you want to test your adapter outside of the wizard, you have 2 main options:

  1. Disable security by adding @OAuthSecurity(enabled=false) before your procedure code (in MyAdapterResource). Keep in mind that your procedure will no longer be protected. See Protecting Adapters.
  2. Generate a test token manually. You can request a test token which you will add to your HTTP headers. See In Postman

The instructions you saw regarding securityTest="wl_unprotected" are for JavaScript adapters, not Java.