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.

login( ) method<br />

login( ) method<br />

Starts a user login session on the current Session object by sending an HTTP request<br />

with user credentials to a URI for a specified <strong>Mobile</strong> Web application. If the user<br />

credentials are authenticated, the login session is started with a unique session ID for<br />

that session that is also passed to the AppServer that implements the <strong>Mobile</strong> Web<br />

application. If the <strong>Mobile</strong> Web application is so configured, along with the session ID, it<br />

also sends a single sign-on (SSO) client-principal with the user credentials to the<br />

AppServer. The method also returns a code indicating the success of the login request.<br />

Notes: Before invoking this method, ensure that you set the authenticationModel<br />

property on the Session object correctly (see the notes on authentication<br />

models).<br />

If the browser or mobile device has already authenticated a user login session,<br />

this method completes successfully.<br />

This method does not support proxy servers (servers that function as a security<br />

service) in Release 11.2.<br />

Return type: Number<br />

Applies to: progress.data.Session class<br />

Syntax<br />

login ( service-uri [ , username , password [ , login-target ] ] )<br />

service-uri<br />

A string expression containing the URI of the <strong>Mobile</strong> Web application for which to<br />

start the user login session. This <strong>Mobile</strong> Web application must support one or<br />

more <strong>OpenEdge</strong> <strong>Mobile</strong> services in order to create JSDOs for the service<br />

resources provided by the application. If HTTP Basic Authentication is in effect for<br />

the <strong>Mobile</strong> Web application (see the notes on authentication models), this URI is<br />

appended with a string that identifies a protected resource against which to<br />

authenticate the login session (see login-target).<br />

If the <strong>Mobile</strong> App from which you are logging in is a <strong>Mobile</strong> Web App deployed to<br />

the same Apache Tomcat server as the <strong>Mobile</strong> Web application, you can specify<br />

service-uri as a relative URI, for example, /Sports<strong>Mobile</strong>App, which is relative<br />

to the deployment end point (Tomcat server domain or host and port).<br />

If the <strong>Mobile</strong> App from which you are logging in is a <strong>Mobile</strong> Native App that will be<br />

installed to run directly in a native device container, or if it is a <strong>Mobile</strong> Web App<br />

deployed to a different Web server from the <strong>Mobile</strong> Web application, you must<br />

specify service-uri as an absolute URI to the Tomcat server domain or host and<br />

port, for example, http://www.progress.com/Sports<strong>Mobile</strong>App, or perhaps for<br />

testing, http://testmach:8980/Sports<strong>Mobile</strong>App.<br />

Note: For any <strong>Mobile</strong> App that must specify service-uri as an absolute URI,<br />

you must maintain separate JavaScript sources to deploy the <strong>Mobile</strong> App<br />

for different <strong>Mobile</strong> Web application environments, such as one for testing<br />

and one for production.<br />

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

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

Saved successfully!

Ooh no, something went wrong!