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.

Comments:

Shay,
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 11.1.1.7 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.

thanks,
Veeresh

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: http://docs.oracle.com/cd/E37975_01/doc.111240/e24475/amxwebservices.htm#CHDIBIIE

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 #

Hi
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 #

Shay,

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

getting no clue what to look n where

thanks,
mrashid

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

Post a Comment:
  • HTML Syntax: NOT allowed
About

me
I'm a Director of Product Management for the Oracle Java Development Tools.
Follow me:
Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today