1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- package org .jitsi .jicofo .rest ;
16+ package org .jitsi .jicofo .auth . rest ;
1717
1818import com .google .common .html .*;
1919import org .jetbrains .annotations .*;
2020import org .jitsi .jicofo .auth .*;
21+ import org .jitsi .jicofo .rest .*;
2122import org .jxmpp .jid .*;
2223import org .jxmpp .jid .impl .*;
2324import org .jxmpp .stringprep .*;
2425
2526import javax .servlet .http .*;
2627import javax .ws .rs .*;
2728import javax .ws .rs .core .*;
28- import javax .ws .rs .core .Response ;
2929
3030import static org .apache .commons .lang3 .StringUtils .isBlank ;
3131
@@ -40,10 +40,9 @@ public class ShibbolethLogin
4040 *
4141 * @param request <tt>HttpServletRequest</tt> instance used to obtain
4242 * Shibboleth attributes.
43- * @param name the name of Shibboleth attribute to get.
44- *
43+ * @param name the name of Shibboleth attribute to get.
4544 * @return Shibboleth attribute value retrieved from the request or
46- * <tt>null</tt> if there is no value for given <tt>name</tt>.
45+ * <tt>null</tt> if there is no value for given <tt>name</tt>.
4746 */
4847 private static String getShibAttr (HttpServletRequest request , String name )
4948 {
@@ -58,7 +57,7 @@ private static String getShibAttr(HttpServletRequest request, String name)
5857 @ NotNull
5958 private final ShibbolethAuthAuthority shibbolethAuthAuthority ;
6059
61- ShibbolethLogin (@ NotNull ShibbolethAuthAuthority shibbolethAuthAuthority )
60+ public ShibbolethLogin (@ NotNull ShibbolethAuthAuthority shibbolethAuthAuthority )
6261 {
6362 this .shibbolethAuthAuthority = shibbolethAuthAuthority ;
6463 }
@@ -135,38 +134,38 @@ private String createResponse(
135134 // Store session-id script
136135 String script =
137136 "<script>\n " +
138- "(function() {\n " +
139- " var sessionId = '" + sessionId + "';\n " +
140- " localStorage.setItem('sessionId', sessionId);\n " +
141- " console.info('sessionID :' + sessionId);\n " +
142- " var displayName = '" + displayName + "';\n " +
143- " console.info('displayName :' + displayName);\n " +
144- " var settings = localStorage.getItem('features/base/settings');\n " +
145- " console.info('settings :' + settings);\n " +
146- " if (settings){\n " +
147- " try {\n " +
148- " var settingsObj = JSON.parse(settings);\n " +
149- " if ( settingsObj && !settingsObj.displayName ) {\n " +
150- " settingsObj.displayName = displayName;\n " +
151- " localStorage.setItem('features/base/settings', JSON.stringify(settingsObj));\n " +
152- " }\n " +
153- " }\n " +
154- " catch(e){\n " +
155- " console.error('Unable to parse settings JSON');\n " +
156- " }\n " +
157- " }\n " ;
137+ "(function() {\n " +
138+ " var sessionId = '" + sessionId + "';\n " +
139+ " localStorage.setItem('sessionId', sessionId);\n " +
140+ " console.info('sessionID :' + sessionId);\n " +
141+ " var displayName = '" + displayName + "';\n " +
142+ " console.info('displayName :' + displayName);\n " +
143+ " var settings = localStorage.getItem('features/base/settings');\n " +
144+ " console.info('settings :' + settings);\n " +
145+ " if (settings){\n " +
146+ " try {\n " +
147+ " var settingsObj = JSON.parse(settings);\n " +
148+ " if ( settingsObj && !settingsObj.displayName ) {\n " +
149+ " settingsObj.displayName = displayName;\n " +
150+ " localStorage.setItem('features/base/settings', JSON.stringify(settingsObj));\n " +
151+ " }\n " +
152+ " }\n " +
153+ " catch(e){\n " +
154+ " console.error('Unable to parse settings JSON');\n " +
155+ " }\n " +
156+ " }\n " ;
158157 if (close )
159158 {
160159 // Pass session id and close the popup
161- script += "var opener = window.opener;\n " +
162- "if (opener) {\n " +
160+ script += "var opener = window.opener;\n " +
161+ "if (opener) {\n " +
163162 " var res = opener.postMessage(" +
164163 " { sessionId: sessionId },\n " +
165- " window.opener.location.href);\n " +
164+ " window.opener.location.href);\n " +
166165 " console.info('res: ', res);\n " +
167- " window.close();\n " +
166+ " window.close();\n " +
168167 "} else {\n " +
169- " console.error('No opener !');\n " +
168+ " console.error('No opener !');\n " +
170169 "}\n " ;
171170 }
172171 else
@@ -182,7 +181,6 @@ private String createResponse(
182181 return sb .toString ();
183182 }
184183}
185-
186184class BadRequestExceptionWithMessage extends BadRequestException
187185{
188186 public BadRequestExceptionWithMessage (String message )
0 commit comments