top

SSO API

To use Samsung Product API, 

<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>

Should be loaded in index.html

The module defines the functionalities of using SSO that are provides as the Samsung TV for Tizen Platform Product API.

Since : 1.0

Table of Contents

  1. 1. Type Definitions
    1. 1.1. SsoLoginState
  2. 2. Interfaces
    1. 2.1. SsoManagerObject
    2. 2.2. SsoManager
    3. 2.3. SsoDataSuccessCallback
    4. 2.4. SsoCallDataSuccessCallback
    5. 2.5. SsoStringSuccessCallback
    6. 2.6. SsoData
    7. 2.7. SsoCallData
  3. 3. Full WebIDL

Summary of Interfaces and Methods

Interface Method
SmartControllerManagerObject  
SmartControllerManagerObject void showAccountView(DOMString widgetName, SsoCallDataSuccessCallback onsuccess, optional ErrorCallback ? onerror);
DOMString getVersion( );
DOMString getLoginUid( );
SsoLoginState getLoginStatus();
void showCreateAccountView(SsoStringSuccessCallback onsuccess, optional ErrorCallback ? onerror);
SsoDataSuccessCallback void onsuccess(SsoData data);
SsoCallDataSuccessCallback void onsuccess(SsoCallData data);
SsoStringSuccessCallback void onsuccess(DOMString data);
SsoData  
SsoCallData  

1. Type Definitions

1.1. SsoLoginState

This enumeration defines login status.

  enum SsoLoginState{
      "SSO_NOT_LOGIN",
      "SSO_LOGIN"
  };

Since : 1.0

The following values are supported

  • SSO_NOT_LOGIN - non login state
  • SSO_LOGIN - login state

2. Interfaces

2.1. SsoManagerObject

The interface defines what is instantiated by the WebApi object of Samsung TV for Tizen Platform Product API.
There will be a webapis.sso object that allows access to the functionality of the Sso API

  [NoInterfaceObject]interface SsoManagerObject {
      readonly attribute SsoManager sso;
  };

  WebApi implements SsoManagerObject;

Since : 1.0

Attributes

  • readonly SsoManagerObject sso
    Namespace for Sso API.

    Since : 1.0

2.2. SsoManager

This interface provides methods to use the Sso functionalities.

  	[NoInterfaceObject]interface SsoManager {
	void showAccountView(DOMString widgetName, SsoCallDataSuccessCallback onsuccess, optional ErrorCallback ? onerror);
	DOMString getVersion( );
	DOMString getLoginUid();
	SsoLoginState getLoginStatus();
	void showCreateAccountView(SsoStringSuccessCallback onsuccess, optional ErrorCallback ? onerror);
};

Since : 1.0

Methods

showAccountView
This method provide for developer to popup the SSO login or logout and after login or logout return the sso information.

  void showAccountView(DOMString widgetName, SsoCallDataSuccessCallback onsuccess, optional ErrorCallback ? onerror);

Since : 1.0

Privilege level: partner

Privilege: http://developer.samsung.com/privilege/sso.partner

Parameters:

  • widgetName: widget name
  • onsuccess: provide status
  • onerror [optional]: provide status, errorName, errorMessage

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if the input parameter is not compatible with the expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any of the input parameters contain an invalid value.

    • with error type UnknownError in any other error case.

Code example:


  webapis.sso.showAccountView("Facebook", onsuccess, onerror);
getVersion
This method get the plugin's version number.

  DOMString getVersion();

Since : 1.0

Privilege level: partner

Privilege: http://developer.samsung.com/privilege/sso.partner

Return value:

DOMString Version

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if the input parameter is not compatible with the expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any of the input parameters contain an invalid value.

    • with error type UnknownError in any other error case.

Code example:


  var result = webapis.sso.getVersion();
getLoginUid
This method provide for developer to get uid.

1. This value pertains privacy data and must be handled within the boundary of privacy regulations within each country.
2. Must not be used other than the designated purpose. (as an input parameter for the Samsung Checkout on TV API)
3. When transmitting outside the TV device, app must employ a secure protocol. (e.g: https)

  DOMString getLoginUid();

Since : 1.0

Privilege level: partner

Privilege: http://developer.samsung.com/privilege/sso.partner

Return value:

DOMString UID

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if the input parameter is not compatible with the expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any of the input parameters contain an invalid value.

    • with error type UnknownError in any other error case.

Code example:


  var result = webapis.sso.getLoginUid();
getLoginStatus
This method provide for developer to get SSO login status.

  SsoLoginState getLoginStatus();

Since : 1.0

Privilege level: partner

Privilege: http://developer.samsung.com/privilege/sso.partner

Return value:

SsoLoginState Login State

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if the input parameter is not compatible with the expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any of the input parameters contain an invalid value.

    • with error type UnknownError in any other error case.

Code example:


  var result = webapis.sso.getLoginStatus();
showCreateAccountView
This method provide for developer to show SSO popup to create a SSO account.

  void showCreateAccountView(SsoStringSuccessCallback onsuccess, optional ErrorCallback ? onerror);

Since : 1.0

Privilege level: partner

Privilege: http://developer.samsung.com/privilege/sso.partner

Parameters:

  • onsuccess: provide context
  • onerror [optional]: provide status, errorName, errorMessage

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if the input parameter is not compatible with the expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any of the input parameters contain an invalid value.

    • with error type UnknownError in any other error case.

Code example:


  webapis.sso.showCreateAccountView(onsuccess, onerror);

2.3. SsoDataSuccessCallback

This callback interface defines login success callback.

  [Callback = FunctionOnly, NoInterfaceObject]interface SsoDataSuccessCallback {
      void onsuccess(SsoData data);
  };

Since : 1.0

Methods

onsuccess
This method is callback parameter.

  void onsuccess(SsoData data);

Since : 1.0

Parameters:

  • data: bLogin, id, authToken, uid, guid

2.4. SsoCallDataSuccessCallback

This callback interface defines login success callback.

  [Callback = FunctionOnly, NoInterfaceObject]interface SsoCallDataSuccessCallback {
      void onsuccess(SsoCallData data);
  };

Since : 1.0

Methods

onsuccess
This method is callback parameter.

  void onsuccess(SsoCallData data);

Since : 1.0

Parameters:

  • data: provide status

2.5. SsoStringSuccessCallback

This callback interface defines login success callback.
  [Callback = FunctionOnly, NoInterfaceObject]interface SsoStringSuccessCallback {
      void onsuccess(DOMString data);
  };

Since : 1.0

Methods

onsuccess
This method is callback parameter.

  void onsuccess(DOMString data);

Since : 1.0

Parameters:

  • data: provide status

2.6. SsoData

This interface defines login data.

  	[NoInterfaceObject] interface SsoData{
	readonly attribute boolean bLogin;
	readonly attribute DOMString id;
	readonly attribute DOMString authToken;
	readonly attribute DOMString uid;
	readonly attribute DOMString guid;
};

Since : 1.0

Attributes

  • readonly boolean bLogin
    This attribute defines login status.

    Since : 1.0

  • readonly DOMString id
    This attribute defines login id.

    Since : 1.0

  • readonly DOMString authToken
    This attribute defines login authToken.

    Since : 1.0

  • readonly DOMString uid
    This attribute defines login uid.

    Since : 1.0

  • readonly DOMString guid
    This attribute defines login guid.

    Since : 1.0

2.7. SsoCallData

This interface defines call success data.

  	[NoInterfaceObject] interface SsoCallData{
    readonly attribute DOMString status;
};

Since : 1.0

Attributes

  • readonly DOMString status
    This attribute defines login status.

    Since : 1.0

3. Full WebIDL


  
module Sso {
	[NoInterfaceObject]interface SsoManagerObject {
		readonly attribute SsoManager sso;
	};
	WebApi implements SsoManagerObject;

	[NoInterfaceObject]interface SsoManager {
		void showAccountView(DOMString widgetName, SsoCallDataSuccessCallback onsuccess, optional ErrorCallback ? onerror);
		DOMString getVersion( );
		DOMString getLoginUid();
		SsoLoginState getLoginStatus();
		void showCreateAccountView(SsoStringSuccessCallback onsuccess, optional ErrorCallback ? onerror);
	};

	[Callback = FunctionOnly, NoInterfaceObject]interface SsoDataSuccessCallback {
		void onsuccess(SsoData data);
	};

	[Callback = FunctionOnly, NoInterfaceObject]interface SsoCallDataSuccessCallback {
		void onsuccess(SsoCallData data);
	};

	[Callback = FunctionOnly, NoInterfaceObject]interface SsoStringSuccessCallback {
		void onsuccess(DOMString data);
	};
		
	[NoInterfaceObject] interface SsoData{
		readonly attribute boolean bLogin;
		readonly attribute DOMString id;
		readonly attribute DOMString authToken;
		readonly attribute DOMString uid;
		readonly attribute DOMString guid;
	};

	[NoInterfaceObject] interface SsoCallData{
		readonly attribute DOMString status;
	};
	
	enum SsoLoginState{
		"SSO_NOT_LOGIN",
		"SSO_LOGIN"
	};
};