Skip to main content

Accessing Single Sign-On from JavaScript

To use Single Sign-On service from your Red App you need to do the following:

  1. Add authorization tag to your redapp.xml - for complete information, see Authorization to Access or Use Services in "Building a redapp.xml File."

<Authorization name="com.sabre.edge.cf.sso.SsoService" threshold="10" metric="tpm" />

  1. Use SSO Web API as described:

function doSso(){
  sp = http://some_service_provider.com;
  params = [['address','Cracow, Poland'],['provider','Sabre']];
  var rsp = sso(sp, params);
  rsp = eval ("("  rsp  ")");

  if(rsp.response.success == true){
    assertion = rsp.response.payload.assertion;
    ...
  }else{
    alert(rsp.response.errors.error[0].code);
  }
}
Note
To use the simplified API, you must use (or inherit from) DefaultWebkitEditor or WebkitView class from the com.sabre.edge.platform.optional.webkit plug-in.

Additional Resources for SSO Service

The Sabre Red 360 Developer Toolkit includes the sample plug-in com.sabre.redapp.example.webkit sample plug-in, accessing SSO service with a JavaScript function.