*** empty log message ***
This commit is contained in:
40
venice-data-sso/sp/scripts/sourceid/defederate.js
Normal file
40
venice-data-sso/sp/scripts/sourceid/defederate.js
Normal file
@@ -0,0 +1,40 @@
|
||||
// The contents of this file are subject to the Mozilla Public License Version 1.1
|
||||
// (the "License"); you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
|
||||
//
|
||||
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
|
||||
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
|
||||
// language governing rights and limitations under the License.
|
||||
//
|
||||
// The Original Code is the Venice Web Communities System.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
|
||||
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
||||
// Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
//
|
||||
// Contributor(s):
|
||||
|
||||
importPackage(Packages.com.silverwrist.dynamo.iface);
|
||||
importPackage(Packages.com.silverwrist.dynamo.util);
|
||||
|
||||
req = bsf.lookupBean("request"); // get request
|
||||
rhelp = bsf.lookupBean("request_help"); // get request helper
|
||||
session = rhelp.session;
|
||||
|
||||
// Make sure we're logged in.
|
||||
user = vlib.getUser(session);
|
||||
if (user.isAnonymous())
|
||||
dynamo.scriptReturn(new Redirect("SERVLET","top.js.vs"));
|
||||
|
||||
// Make sure a provider ID is provided.
|
||||
provider = rhelp.getParameterString("provider");
|
||||
if (provider==null)
|
||||
dynamo.scriptReturn(new Redirect("SERVLET","top.js.vs"));
|
||||
|
||||
// Create a defederation request.
|
||||
rc = new ForwardToPath("/sso/fedterm");
|
||||
rc.setParameter("ProviderID",provider);
|
||||
rc.setParameter("UserID",user); // pass our user object to SourceID
|
||||
rc.setParameter("Return.Success","/top.js.vs");
|
||||
rc.setParameter("Return.Failure","/top.js.vs");
|
||||
dynamo.scriptReturn(rc);
|
||||
25
venice-data-sso/sp/scripts/sourceid/errorHandler.js
Normal file
25
venice-data-sso/sp/scripts/sourceid/errorHandler.js
Normal file
@@ -0,0 +1,25 @@
|
||||
// The contents of this file are subject to the Mozilla Public License Version 1.1
|
||||
// (the "License"); you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
|
||||
//
|
||||
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
|
||||
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
|
||||
// language governing rights and limitations under the License.
|
||||
//
|
||||
// The Original Code is the Venice Web Communities System.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
|
||||
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
||||
// Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
//
|
||||
// Contributor(s):
|
||||
|
||||
importPackage(Packages.com.silverwrist.dynamo.iface);
|
||||
importPackage(Packages.com.silverwrist.dynamo.util);
|
||||
importPackage(Packages.com.silverwrist.venice.content);
|
||||
|
||||
req = bsf.lookupBean("request"); // get request
|
||||
rhelp = bsf.lookupBean("request_help"); // get request helper
|
||||
|
||||
ex = cast.toThrowable(rhelp.getChainParameter("javax.servlet.jsp.jspException"));
|
||||
dynamo.scriptReturn(new ErrorBox("Captured SourceID Error",ex));
|
||||
43
venice-data-sso/sp/scripts/sourceid/federate.js
Normal file
43
venice-data-sso/sp/scripts/sourceid/federate.js
Normal file
@@ -0,0 +1,43 @@
|
||||
// The contents of this file are subject to the Mozilla Public License Version 1.1
|
||||
// (the "License"); you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
|
||||
//
|
||||
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
|
||||
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
|
||||
// language governing rights and limitations under the License.
|
||||
//
|
||||
// The Original Code is the Venice Web Communities System.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
|
||||
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
||||
// Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
//
|
||||
// Contributor(s):
|
||||
|
||||
importPackage(Packages.com.silverwrist.dynamo.iface);
|
||||
importPackage(Packages.com.silverwrist.dynamo.util);
|
||||
|
||||
req = bsf.lookupBean("request"); // get request
|
||||
rhelp = bsf.lookupBean("request_help"); // get request helper
|
||||
session = rhelp.session;
|
||||
|
||||
// Make sure we're logged in.
|
||||
user = vlib.getUser(session);
|
||||
if (user.isAnonymous())
|
||||
dynamo.scriptReturn(new Redirect("SERVLET","top.js.vs"));
|
||||
|
||||
// Make sure a provider ID is provided.
|
||||
provider = rhelp.getParameterString("provider");
|
||||
if (provider==null)
|
||||
dynamo.scriptReturn(new Redirect("SERVLET","top.js.vs"));
|
||||
|
||||
// Create an Authenticate + Federate request and send it off.
|
||||
rc = new ForwardToPath("/sso/authnRequest");
|
||||
rc.setParameter("ProviderID",provider);
|
||||
rc.setParameter("IsPassive",cast.booleanObject(false));
|
||||
rc.setParameter("ForceAuthn",cast.booleanObject(false));
|
||||
rc.setParameter("Federate",cast.booleanObject(true));
|
||||
rc.setParameter("UserID",user); // pass our user object to SourceID
|
||||
rc.setParameter("Return.Success","/top.js.vs");
|
||||
rc.setParameter("Return.Failure","/top.js.vs");
|
||||
dynamo.scriptReturn(rc);
|
||||
40
venice-data-sso/sp/scripts/sourceid/login_sso.js
Normal file
40
venice-data-sso/sp/scripts/sourceid/login_sso.js
Normal file
@@ -0,0 +1,40 @@
|
||||
// The contents of this file are subject to the Mozilla Public License Version 1.1
|
||||
// (the "License"); you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
|
||||
//
|
||||
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
|
||||
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
|
||||
// language governing rights and limitations under the License.
|
||||
//
|
||||
// The Original Code is the Venice Web Communities System.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
|
||||
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
||||
// Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
//
|
||||
// Contributor(s):
|
||||
|
||||
importPackage(Packages.com.silverwrist.dynamo.iface);
|
||||
importPackage(Packages.com.silverwrist.dynamo.util);
|
||||
|
||||
req = bsf.lookupBean("request"); // get request
|
||||
rhelp = bsf.lookupBean("request_help"); // get request helper
|
||||
target = rhelp.getParameterString("tgt"); // get the target for this operation
|
||||
if (target==null)
|
||||
target = "top.js.vs";
|
||||
vlib.setOnError(req,target);
|
||||
|
||||
// Save the target string where we can find it again when we land after validating the login..
|
||||
sess = rhelp.session;
|
||||
sess.setObject("venice-sso:","target",target);
|
||||
|
||||
// Get the provider ID and pass it to SourceID's applet.
|
||||
p = rhelp.getParameterString("provider");
|
||||
rc = new ForwardToPath("/sso/authnRequest");
|
||||
rc.setParameter("ProviderID",p);
|
||||
rc.setParameter("IsPassive",cast.booleanObject(false));
|
||||
rc.setParameter("ForceAuthn",cast.booleanObject(false));
|
||||
rc.setParameter("Federate",cast.booleanObject(false));
|
||||
rc.setParameter("Return.Success","/sourceid/login_sso_ok.js.vs");
|
||||
rc.setParameter("Return.Failure","/sourceid/login_sso_fail.js.vs");
|
||||
dynamo.scriptReturn(rc);
|
||||
34
venice-data-sso/sp/scripts/sourceid/login_sso_fail.js
Normal file
34
venice-data-sso/sp/scripts/sourceid/login_sso_fail.js
Normal file
@@ -0,0 +1,34 @@
|
||||
// The contents of this file are subject to the Mozilla Public License Version 1.1
|
||||
// (the "License"); you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
|
||||
//
|
||||
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
|
||||
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
|
||||
// language governing rights and limitations under the License.
|
||||
//
|
||||
// The Original Code is the Venice Web Communities System.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
|
||||
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
||||
// Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
//
|
||||
// Contributor(s):
|
||||
|
||||
importPackage(Packages.com.silverwrist.dynamo.iface);
|
||||
importPackage(Packages.com.silverwrist.dynamo.util);
|
||||
|
||||
req = bsf.lookupBean("request"); // get request
|
||||
rhelp = bsf.lookupBean("request_help"); // get request helper
|
||||
|
||||
// Retrieve the "target" string from the session.
|
||||
session = rhelp.session;
|
||||
target = session.getObject("venice-sso:","target") + "";
|
||||
session.removeObject("venice-sso:","target");
|
||||
|
||||
// Retrieve the error parameter and build an error message to feed to the dialog box.
|
||||
msg = rhelp.getChainParameter("Failure.Reason");
|
||||
fullmsg = "SSO authentication failure: " + msg + ". Please try again.";
|
||||
session.setObject("venice-sso:","failure.message",fullmsg);
|
||||
|
||||
// Now bounce back to the login dialog.
|
||||
dynamo.scriptReturn(new Redirect("SERVLET","login.js.vs?tgt=" + stringutils.encodeURL(target)));
|
||||
77
venice-data-sso/sp/scripts/sourceid/login_sso_ok.js
Normal file
77
venice-data-sso/sp/scripts/sourceid/login_sso_ok.js
Normal file
@@ -0,0 +1,77 @@
|
||||
// The contents of this file are subject to the Mozilla Public License Version 1.1
|
||||
// (the "License"); you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
|
||||
//
|
||||
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
|
||||
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
|
||||
// language governing rights and limitations under the License.
|
||||
//
|
||||
// The Original Code is the Venice Web Communities System.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
|
||||
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
||||
// Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
//
|
||||
// Contributor(s):
|
||||
|
||||
importClass(Packages.com.silverwrist.dynamo.Namespaces);
|
||||
importClass(Packages.com.silverwrist.dynamo.UserInfoNamespace);
|
||||
importPackage(Packages.com.silverwrist.dynamo.iface);
|
||||
importPackage(Packages.com.silverwrist.dynamo.util);
|
||||
importClass(Packages.com.silverwrist.venice.VeniceNamespaces);
|
||||
importPackage(Packages.com.silverwrist.venice.frame);
|
||||
importPackage(Packages.com.silverwrist.venice.session);
|
||||
|
||||
req = bsf.lookupBean("request"); // get request
|
||||
rhelp = bsf.lookupBean("request_help"); // get request helper
|
||||
|
||||
// Retrieve the "target" string from the session.
|
||||
session = rhelp.session;
|
||||
target = session.getObject("venice-sso:","target") + "";
|
||||
session.removeObject("venice-sso:","target");
|
||||
|
||||
// The authenticated User ID (user object) is in the request attributes. It may be a proxy, so unwrap it.
|
||||
auth_user = cast.queryDynamoUser(dynamo.unwrapObject(rhelp.getChainParameter("UserID")));
|
||||
|
||||
// There are some Dynamo-specific tests we need to make before we can be comfortable with logging in as
|
||||
// this user. Do those now.
|
||||
errmsg = null;
|
||||
if (auth_user==null)
|
||||
{ // user account not found
|
||||
errmsg = "The user account you have specified does not exist. Please try again.";
|
||||
audit.write(req,null,VeniceNamespaces.USER_EVENT_NAMESPACE,"login.fail","Bad username");
|
||||
|
||||
} // end if
|
||||
else if (auth_user.isAnonymous())
|
||||
{ // can't log in as Anonymous_Honyak!
|
||||
errmsg = "This account cannot be explicitly logged into. Please try again.";
|
||||
audit.write(req,auth_user,VeniceNamespaces.USER_EVENT_NAMESPACE,"login.fail","Anonymous user");
|
||||
|
||||
} // end if
|
||||
else if (auth_user.isLocked())
|
||||
{ // locked account - can't log in
|
||||
errmsg = "This account has been locked out. Please contact the system administrator for assistance.";
|
||||
audit.write(req,auth_user,VeniceNamespaces.USER_EVENT_NAMESPACE,"login.fail","Locked Account");
|
||||
|
||||
} // end else if
|
||||
|
||||
if (errmsg!=null)
|
||||
{ // send the error message back to the login dialog
|
||||
session.setObject("venice-sso:","failure.message",errmsg);
|
||||
dynamo.scriptReturn(new Redirect("SERVLET","login.js.vs?tgt=" + stringutils.encodeURL(target)));
|
||||
|
||||
} // end if
|
||||
|
||||
logger.debug("User \"" + auth_user.getName() + "\" logged in successfully");
|
||||
session.setObject(SessionInfoParams.NAMESPACE,SessionInfoParams.ATTR_USER,auth_user);
|
||||
audit.write(req,auth_user,VeniceNamespaces.USER_EVENT_NAMESPACE,"login.ok");
|
||||
auth_user.setLastAccessDate(auth_user,new java.util.Date());
|
||||
|
||||
// Now set up this user's default objects.
|
||||
dynamo.exec("/util/setup_user.js");
|
||||
|
||||
// Has the user verified their E-mail address yet? If not, bounce them there.
|
||||
if (PropertyUtils.hasProperty(auth_user,VeniceNamespaces.USER_SETTINGS_NAMESPACE,"confirmation.number"))
|
||||
dynamo.scriptReturn(new Redirect("SERVLET","verify_email.js.vs?tgt=" + stringutils.encodeURL(target)));
|
||||
else
|
||||
dynamo.scriptReturn(new Redirect("SERVLET",target));
|
||||
42
venice-data-sso/sp/scripts/sourceid/logout_sso.js
Normal file
42
venice-data-sso/sp/scripts/sourceid/logout_sso.js
Normal file
@@ -0,0 +1,42 @@
|
||||
// The contents of this file are subject to the Mozilla Public License Version 1.1
|
||||
// (the "License"); you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
|
||||
//
|
||||
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
|
||||
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
|
||||
// language governing rights and limitations under the License.
|
||||
//
|
||||
// The Original Code is the Venice Web Communities System.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
|
||||
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
||||
// Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
//
|
||||
// Contributor(s):
|
||||
|
||||
importPackage(Packages.com.silverwrist.dynamo.iface);
|
||||
importPackage(Packages.com.silverwrist.dynamo.util);
|
||||
|
||||
req = bsf.lookupBean("request"); // get request
|
||||
rhelp = bsf.lookupBean("request_help"); // get request helper
|
||||
session = rhelp.session;
|
||||
|
||||
// Make sure we're logged in.
|
||||
user = vlib.getUser(session);
|
||||
if (user.isAnonymous())
|
||||
dynamo.scriptReturn(new Redirect("SERVLET","top.js.vs"));
|
||||
|
||||
// Make sure a provider ID is provided.
|
||||
provider = rhelp.getParameterString("provider");
|
||||
if (provider==null)
|
||||
dynamo.scriptReturn(new Redirect("SERVLET","top.js.vs"));
|
||||
|
||||
// Log out locally first.
|
||||
session.detach();
|
||||
|
||||
// Now log out remotely by going through SourceID.
|
||||
rc = new ForwardToPath("/sso/logout");
|
||||
rc.setParameter("ProviderID",provider);
|
||||
rc.setParameter("Return.Success","/top.js.vs");
|
||||
rc.setParameter("Return.Failure","/top.js.vs");
|
||||
dynamo.scriptReturn(rc);
|
||||
Reference in New Issue
Block a user