Package org.wso2.carbon.hostobjects.sso
Class SAMLSSORelyingPartyObject
- java.lang.Object
-
- org.mozilla.javascript.ScriptableObject
-
- org.wso2.carbon.hostobjects.sso.SAMLSSORelyingPartyObject
-
- All Implemented Interfaces:
Serializable,org.mozilla.javascript.ConstProperties,org.mozilla.javascript.debug.DebuggableObject,org.mozilla.javascript.Scriptable
public class SAMLSSORelyingPartyObject extends org.mozilla.javascript.ScriptableObjectThis class wrap up the operations needed to write a saml relying party for sso use case.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SAMLSSORelyingPartyObject()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Stringdecode(String xmlString)Decode xmlStringgetClassName()static org.mozilla.javascript.ScriptablejsConstructor(org.mozilla.javascript.Context cx, Object[] args, org.mozilla.javascript.Function ctorObj, boolean inNewExpr)static StringjsFunction_decode(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)Decoding and deflating the encoded AuthReqstatic StringjsFunction_encode(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)Compressing and Encoding the responsestatic StringjsFunction_getIdentitySessionId(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)static StringjsFunction_getLoggedInUser(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)static StringjsFunction_getProperty(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)Get SSO configuration properties.static StringjsFunction_getRelayStateProperty(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)Get requested URI for relay state.static StringjsFunction_getSAMLAuthRequest(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)Get SAML authentication request build with given issuerstatic StringjsFunction_getSAMLLogoutRequest(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)Get SAML logout request build.static StringjsFunction_getSAMLResponseNameId(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)Extract the name of authenticated user from SAML response.static StringjsFunction_getSAMLToken(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)static StringjsFunction_getUUID(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)generate a UUIDstatic voidjsFunction_invalidateSessionBySAMLResponse(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)Invalidate current browser authenticated session based on SAML log out request session index value.static voidjsFunction_invalidateSessionBySessionId(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)Invalidate current browser authenticated session based on session id.static booleanjsFunction_isLogoutRequest(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)static booleanjsFunction_isLogoutResponse(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)static booleanjsFunction_isSessionAuthenticated(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)Check if the browser session is valid.static voidjsFunction_setProperty(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)Set SSO Configuration key,valuesstatic voidjsFunction_setRelayStateProperty(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)Set relay state property with requested uri.static voidjsFunction_setSessionAuthenticated(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)Set the current session as authenticated by mapping with current session id to session index.static booleanjsFunction_validateSignature(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)static StringjsFunction_xmlDecode(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)static StringjsFunction_xmlEncode(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)-
Methods inherited from class org.mozilla.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, equivalentValues, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasInstance, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size
-
-
-
-
Method Detail
-
getClassName
public String getClassName()
- Specified by:
getClassNamein interfaceorg.mozilla.javascript.Scriptable- Specified by:
getClassNamein classorg.mozilla.javascript.ScriptableObject
-
jsConstructor
public static org.mozilla.javascript.Scriptable jsConstructor(org.mozilla.javascript.Context cx, Object[] args, org.mozilla.javascript.Function ctorObj, boolean inNewExpr) throws Exception- Parameters:
cx-args- - args[0]-issuerId, this issuer need to be registered in Identity server.ctorObj-inNewExpr-- Returns:
- Throws:
Exception
-
jsFunction_validateSignature
public static boolean jsFunction_validateSignature(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws Exception- Parameters:
cx-thisObj-args- -args[0]- SAML response xmlfunObj-- Returns:
- Throws:
Exception
-
jsFunction_isLogoutRequest
public static boolean jsFunction_isLogoutRequest(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws Exception- Parameters:
cx-thisObj-args- -args[0]-Logout request xml as a string.funObj-- Returns:
- Throws:
Exception
-
jsFunction_isLogoutResponse
public static boolean jsFunction_isLogoutResponse(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws Exception- Parameters:
cx-thisObj-args- -args[0]- Logout response xml as a stringfunObj-- Returns:
- Throws:
Exception
-
jsFunction_encode
public static String jsFunction_encode(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws Exception
Compressing and Encoding the response- Parameters:
cx-thisObj-args- -args[0]- string to be encoded.funObj-- Returns:
- Throws:
Exception
-
jsFunction_getSAMLToken
public static String jsFunction_getSAMLToken(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws Exception
- Throws:
Exception
-
jsFunction_decode
public static String jsFunction_decode(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws Exception
Decoding and deflating the encoded AuthReq- Parameters:
cx-thisObj-args- -args[0]-String to be decodedfunObj-- Returns:
- Throws:
Exception
-
jsFunction_getUUID
public static String jsFunction_getUUID(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws Exception
generate a UUID- Parameters:
cx-thisObj-args-funObj-- Returns:
- Throws:
Exception
-
jsFunction_getSAMLAuthRequest
public static String jsFunction_getSAMLAuthRequest(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws Exception
Get SAML authentication request build with given issuer- Parameters:
cx-thisObj-args-funObj-- Returns:
- Throws:
Exception
-
jsFunction_getSAMLLogoutRequest
public static String jsFunction_getSAMLLogoutRequest(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws Exception
Get SAML logout request build.- Parameters:
cx-thisObj-args- -args[0]-the user to be logoutfunObj-- Returns:
- Throws:
Exception
-
jsFunction_getSAMLResponseNameId
public static String jsFunction_getSAMLResponseNameId(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws Exception
Extract the name of authenticated user from SAML response.- Parameters:
cx-thisObj-args-funObj-- Returns:
- Throws:
Exception
-
jsFunction_setProperty
public static void jsFunction_setProperty(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws ScriptExceptionSet SSO Configuration key,values- Parameters:
cx-thisObj-args-funObj-- Throws:
ScriptException
-
jsFunction_isSessionAuthenticated
public static boolean jsFunction_isSessionAuthenticated(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws ScriptExceptionCheck if the browser session is valid. If user is log out from any sso service provider, user session is invalidated.- Parameters:
cx-thisObj-args-funObj-- Returns:
- Throws:
ScriptException
-
jsFunction_getIdentitySessionId
public static String jsFunction_getIdentitySessionId(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws ScriptException
- Throws:
ScriptException
-
jsFunction_getLoggedInUser
public static String jsFunction_getLoggedInUser(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws ScriptException
- Throws:
ScriptException
-
jsFunction_invalidateSessionBySAMLResponse
public static void jsFunction_invalidateSessionBySAMLResponse(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws ExceptionInvalidate current browser authenticated session based on SAML log out request session index value.- Parameters:
cx-thisObj-args-funObj-- Throws:
Exception
-
jsFunction_invalidateSessionBySessionId
public static void jsFunction_invalidateSessionBySessionId(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws ExceptionInvalidate current browser authenticated session based on session id. Session will be invalidated after user log out request get succeeded.- Parameters:
cx-thisObj-args-funObj-- Throws:
Exception
-
jsFunction_setSessionAuthenticated
public static void jsFunction_setSessionAuthenticated(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws ExceptionSet the current session as authenticated by mapping with current session id to session index.- Parameters:
cx-thisObj-args- -args[0]- current session id, args[1]-SAML responsefunObj-- Throws:
Exception
-
jsFunction_getProperty
public static String jsFunction_getProperty(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws ScriptException
Get SSO configuration properties.- Parameters:
cx-thisObj-args- -args[0]-configuration keyfunObj-- Returns:
- Throws:
ScriptException
-
jsFunction_setRelayStateProperty
public static void jsFunction_setRelayStateProperty(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws ScriptExceptionSet relay state property with requested uri.- Parameters:
cx-thisObj-args-funObj-- Throws:
ScriptException
-
jsFunction_getRelayStateProperty
public static String jsFunction_getRelayStateProperty(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws ScriptException
Get requested URI for relay state. And relay state value is removed, as relay state is unique and onetime value.- Parameters:
cx-thisObj-args-funObj-- Returns:
- Throws:
ScriptException
-
jsFunction_xmlDecode
public static String jsFunction_xmlDecode(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws ScriptException
- Throws:
ScriptException
-
jsFunction_xmlEncode
public static String jsFunction_xmlEncode(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws ScriptException
- Throws:
ScriptException
-
-