Project

General

Profile

« Previous | Next » 

Revision 7390

look up CN url for portal servlet instead of hardcoding it.

View differences:

lib/style/skins/dataone/performMapping.jsp
54 54

  
55 55
// get the CN environment, dynamically
56 56
String cnURL = D1Client.getCN().getNodeBaseServiceUrl();
57
String portalURL = cnURL.substring(0, cnURL.lastIndexOf(new URL(cnURL).getPath())) + "/portal/identity";
58
//String portalURL =  "https://cn-dev.dataone.org/portal/identity";
57
String portalURL = cnURL.substring(0, cnURL.lastIndexOf(new URL(cnURL).getPath())) + "/portal";
58
//String portalURL =  "https://cn-dev.dataone.org/portal";
59 59

  
60 60
//check the DataONE token
61
String tokenURL = portalURL + "?action=isAuthenticated&token=" + token;
61
String tokenURL = portalURL + "/identity?action=isAuthenticated&token=" + token;
62 62
InputStream tokenInputStream = new URL(tokenURL).openStream();
63 63
String tokenContent = IOUtils.toString(tokenInputStream, "UTF-8");
64 64
tokenContent = tokenContent.trim();
65 65
boolean isD1SessionValid = Boolean.parseBoolean(tokenContent);
66 66

  
67 67
// look up the D1 subject
68
String subjectURL = portalURL + "?action=getSubject&token=" + token;
68
String subjectURL = portalURL + "/identity?action=getSubject&token=" + token;
69 69
InputStream subjectStream = new URL(subjectURL).openStream();
70 70
primarySubject = IOUtils.toString(subjectStream, "UTF-8");
71 71
primarySubject = primarySubject.trim();
lib/style/skins/dataone/index.jsp
1 1
<%@ page language="java"%>
2
<%@page import="org.dataone.client.D1Client"%>
3
<%@page import="java.net.URL"%>
2 4
<%
3 5
	/**
4 6
	 *  '$RCSfile$'
......
34 36
<%@page import="edu.ucsb.nceas.metacat.service.SessionService"%>
35 37
<%
36 38

  
39
//get the CN environment, dynamically
40
String cnURL = D1Client.getCN().getNodeBaseServiceUrl();
41
String portalURL = cnURL.substring(0, cnURL.lastIndexOf(new URL(cnURL).getPath())) + "/portal";
42
//String portalURL =  "https://cn.dataone.org/portal";
43

  
37 44
// what was the given DataONE identity?
38 45
String d1Identity = request.getParameter("d1Identity");
39 46
String token = request.getParameter("token");
......
113 120
		<br/>
114 121

  
115 122
		Will be mapped to this DataONE account*: 
116
		<iframe id="subjectFrame" frameborder="0" marginwidth="0" height="30" width="100%" src="https://cn-dev.dataone.org/portal/identity?action=getSubject">
123
		<iframe id="subjectFrame" frameborder="0" marginwidth="0" height="30" width="100%" src="<%=portalURL %>/identity?action=getSubject">
117 124
		</iframe>
118 125

  
119 126
		<hr/>		
120 127

  
121 128
		1. Use this temporary DataONE token*: 
122
		<iframe id="tokenFrame" frameborder="0" marginwidth="0" height="30" width="100%" src="https://cn-dev.dataone.org/portal/identity?action=getToken">
129
		<iframe id="tokenFrame" frameborder="0" marginwidth="0" height="30" width="100%" src="<%=portalURL %>/identity?action=getToken">
123 130
		</iframe>
124 131
		<br/>
125 132
		
......
140 147
			*If you do not see your DataONE account or DataONE token here, then you must first authenticate using CILogon.
141 148
		</p>
142 149
		<p>
143
			<a href="https://cn-dev.dataone.org/portal/startRequest?target=<%=STYLE_SKINS_URL%>/dataone/index.jsp">Begin Login</a>
150
			<a href="<%=portalURL %>/startRequest?target=<%=STYLE_SKINS_URL%>/dataone/index.jsp">Begin Login</a>
144 151
		</p>
145 152
	</div>
146 153

  

Also available in: Unified diff