Accessing Secure Web Services from ADF Mobile

Most of the enterprise Web services you'll access are going to be secured - meaning they'll require you to pass a user/password in order to get to their data. 

If you never created a secured Web service, it's simple in JDeveloper! For the below video I just right clicked on a Java class that I exposed as a Web service, and chose  "Web Service Properties" and then checked the "oracle/wss_username_token_service_policy" box from the list of options (that's the option supported by ADF Mobile right now):

In the demo below we are going to use a "remote" login server that does the authentication of the user/pass.

The easiest way to "create" a remote login server is to create a "regular" web ADF application, secure it, and deploy it on a server. The secured ADF application can just require ADF Authentication with a simple HTTP Basic Authentication - basically the next two images in the Application->Secure->Configure ADF Security menu wizard.

ok - so now you have a secured ADF application - deploy it on a server and get the URL for that application. 

From this point on you'll see the process in the video which deals with the configuration of your ADF Mobile app.

First you'll need to enable security for your ADF mobile application, so it will prompt users to provide a user/pass combination.

You'll also need to configure security on specific features. And you can have them use remote login pointing to your regular secured ADF application.

Next define your Web service data control. Right click on the web service data control to "define Web Service Security".

You'll also need to define the adfCredentialStoreKey property for the Web Service data control in the connections.xml file.

This should be it. Here is the flow:

If you haven't already - you can read more about this in the Mobile developer guide, and Andrejus has a sample for you.


Would you be able to create a future post showing how to create a disconnected ADF Mobile app that uses the local SQLite database, and uses the secure web service to synchronize enterprise data with the local database? Is there a declarative way to define the SQLite DB and data controls?

Posted by Ben on January 03, 2013 at 07:07 AM PST #

+1 for Ben's comment, I want to see some approach like this

Posted by guest on March 31, 2013 at 10:01 PM PDT #

Hi Shay,
this example is very useful to people like us who are just entered into ADF mobile world..
I created same application as you showed but the problem is I am not able to run it on android emulator..
it is showing error as "Cannot connect to login server..."
& sometimes as "Authentication error with unknown cause..Please contact administrator"
This is really irritating..

can you please tell me why this error is coming?

Posted by Laxmi Nadageri on April 03, 2013 at 01:30 AM PDT #

Laxmi, make sure that the emulator can actually access your Web service by trying to access the WSDL through the browser on the emulator.

Posted by Shay on April 09, 2013 at 09:54 AM PDT #

Hi Shay,
Can we provide an authentication url of the adf app developed using for adf mobile?

Posted by guest on August 24, 2013 at 05:00 PM PDT #

guest - yes you can use any ADF version for the login app, and in fact it doesn't even need to be an ADF app, just an app that prompts for a login.

Posted by Shay on August 26, 2013 at 09:22 AM PDT #

Hi Shay,

Is it possible to access secured web service, without securing the mobile application? You are using some remote server to authenticate the login, in my use case I don't want to do that.

One more question I have is, I am new to OWSM policies, how can I send username and password to web service using this policies ?

I am struck here, Please suggest.


Posted by Veeresh on February 19, 2014 at 03:09 AM PST #

Veeresh, you might be able to pass security information by customizing the SOAP Header as shown in the doc here:

Posted by Shay Shmeltzer on February 20, 2014 at 01:18 PM PST #

i m new to adf mobile...on trying the steps above i just keep on getting conifugration error..shutdown

getting no clue what to look n where

Posted by pratik on June 26, 2014 at 03:41 AM PDT #

i am getting error <b> "Authentication error with unknow cause. Please contact Administrator. Error code :4.Details 4:Tokens there are requested are not available in server"</b>

Posted by guest on June 30, 2014 at 09:41 AM PDT #


on trying the steps above i just keep on getting
configuration error..shutdown

getting no clue what to look n where


Posted by mrashid on July 10, 2014 at 04:04 AM PDT #

Hi, Shay,

I had got the same message as marshid, can you tell me why?

Thank you!

gt fan

Posted by guest on August 10, 2014 at 12:44 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

I'm a Director of Product Management for Oracle's Cloud Development Tools and Frameworks.
Follow me:

« July 2016