01.06.2013 Views

OpenEdge Development: Mobile Applications - Product ...

OpenEdge Development: Mobile Applications - Product ...

OpenEdge Development: Mobile Applications - Product ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 1: <strong>OpenEdge</strong> <strong>Mobile</strong> Overview<br />

Access to <strong>Mobile</strong> services with user login sessions<br />

In Figure 3, it is the JSDO catalog for the OrderEntry service that ultimately enables<br />

JavaScript methods of the Customers JSDO to execute ABL methods of the<br />

Customers class to implement operations of the Customers resource. Before it can<br />

create and use a JSDO to access a <strong>Mobile</strong> resource, an <strong>OpenEdge</strong> <strong>Mobile</strong> App must<br />

log into the appropriate <strong>Mobile</strong> Web application and load the catalog file for the <strong>Mobile</strong><br />

service that provides the resource.<br />

Depending on the Web server and <strong>Mobile</strong> Web application security configuration, the<br />

<strong>Mobile</strong> App can log into the Web application as directed by the Web server, native<br />

device container, or browser, or by using the login( ) method of the <strong>OpenEdge</strong><br />

JavaScript class, progress.data.Session. If the <strong>Mobile</strong> App login successfully<br />

occurs before calling this login( ) method, the <strong>Mobile</strong> App must still call the method<br />

in order to establish the login session with the <strong>Mobile</strong> Web application and load its<br />

JSDO catalog files.<br />

To use a Session object to establish the login session, the <strong>Mobile</strong> App creates an<br />

instance of the class and invokes the login( ) method on that instance, passing the<br />

<strong>Mobile</strong> Web application URI and optional user credentials as parameters. The exact<br />

user login sequence can be affected by the Web server security configuration, the<br />

<strong>Mobile</strong> App type, design, and platform, and how <strong>Mobile</strong> Web application resources are<br />

protected on the Web server. For example, if the required user credentials have<br />

already been authenticated prior to calling this method, any user credentials you pass<br />

to the method are ignored. For more information on establishing a login session for a<br />

<strong>Mobile</strong> App, see Chapter 4, “Creating <strong>Mobile</strong> Apps using JSDOs.”<br />

Loading the JSDO catalog<br />

Once the login( ) method on a Session object has been successfully called for a<br />

given <strong>OpenEdge</strong> <strong>Mobile</strong> Web application, the <strong>Mobile</strong> App can then call the<br />

addCatalog( ) method on the Session object to load the JSDO catalog for each<br />

<strong>Mobile</strong> service in the <strong>Mobile</strong> Web application it needs to access. Each JSDO catalog<br />

has a URI that you pass to this method, along with optional user credentials if the<br />

catalog requires separate user authentication. Note that by default the filename for a<br />

JSDO catalog has the name of the <strong>Mobile</strong> service for which the catalog is created.<br />

Therefore, its filename and extension have the form, service-name.json. Once a login<br />

session is successfully established, and all required JSDO catalogs are loaded, the<br />

<strong>Mobile</strong> App can invoke operations for all authorized <strong>Mobile</strong> services and resources.<br />

Note that <strong>Mobile</strong> services and resources in a <strong>Mobile</strong> Web application are protected<br />

using the Spring Security framework, which is installed with <strong>OpenEdge</strong> to secure<br />

<strong>Mobile</strong> and REST Web applications. For more information on using Spring Security to<br />

secure <strong>Mobile</strong> or REST Web applications, see the sections on managing REST<br />

application security in <strong>OpenEdge</strong> Application Server: Administration.<br />

Single sign-on to the AppServer<br />

<strong>OpenEdge</strong> also supports single sign-on (SSO) to the AppServer for a user login<br />

session, depending on the <strong>OpenEdge</strong> <strong>Mobile</strong> Web application security configuration.<br />

When appropriately configured, and after a <strong>Mobile</strong> Web application authenticates a<br />

login session, the application creates an SSO client-principal that it sends to the<br />

AppServer with each AppServer request generated by a JSDO. This client-principal<br />

contains the user ID used to login a <strong>Mobile</strong> App and a unique session ID. The<br />

AppServer can then access this client-principal using the CURRENT-REQUEST-INFO<br />

attribute on the SESSION system handle and use it to establish an SSO login session<br />

for the current request.<br />

40 <strong>OpenEdge</strong> ® <strong>Development</strong>: <strong>Mobile</strong> <strong>Applications</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!