Remove Code from cadi, it is now in authz
[aaf/cadi.git] / core / src / main / java / org / onap / aaf / cadi / taf / LoginPageTafResp.java
diff --git a/core/src/main/java/org/onap/aaf/cadi/taf/LoginPageTafResp.java b/core/src/main/java/org/onap/aaf/cadi/taf/LoginPageTafResp.java
deleted file mode 100644 (file)
index b6bb385..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************\r
- * ============LICENSE_START====================================================\r
- * * org.onap.aaf\r
- * * ===========================================================================\r
- * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
- * * ===========================================================================\r
- * * Licensed under the Apache License, Version 2.0 (the "License");\r
- * * you may not use this file except in compliance with the License.\r
- * * You may obtain a copy of the License at\r
- * * \r
- *  *      http://www.apache.org/licenses/LICENSE-2.0\r
- * * \r
- *  * Unless required by applicable law or agreed to in writing, software\r
- * * distributed under the License is distributed on an "AS IS" BASIS,\r
- * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * * See the License for the specific language governing permissions and\r
- * * limitations under the License.\r
- * * ============LICENSE_END====================================================\r
- * *\r
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
- * *\r
- ******************************************************************************/\r
-package org.onap.aaf.cadi.taf;\r
-\r
-import java.io.IOException;\r
-import java.net.URI;\r
-import java.util.List;\r
-\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import org.onap.aaf.cadi.Access;\r
-import org.onap.aaf.cadi.Locator;\r
-import org.onap.aaf.cadi.Access.Level;\r
-import org.onap.aaf.cadi.Locator.Item;\r
-\r
-public class LoginPageTafResp extends AbsTafResp {\r
-       private final HttpServletResponse httpResp;\r
-       private final String loginPageURL;\r
-\r
-       private LoginPageTafResp(Access access, final HttpServletResponse resp, String loginPageURL) {\r
-               super(access, null, "Multiple Possible HTTP Logins available.  Redirecting to Login Choice Page");\r
-               httpResp = resp;\r
-               this.loginPageURL = loginPageURL;\r
-       }\r
-\r
-       @Override\r
-       public RESP authenticate() throws IOException {\r
-               httpResp.sendRedirect(loginPageURL);\r
-               return RESP.HTTP_REDIRECT_INVOKED;\r
-       }\r
-       \r
-       @Override\r
-       public RESP isAuthenticated() {\r
-               return RESP.TRY_AUTHENTICATING;\r
-       }\r
-       \r
-       public static TafResp create(Access access, Locator<URI> locator, final HttpServletResponse resp, List<Redirectable> redir) {\r
-               if(locator!=null) {\r
-                       try {\r
-                               Item item = locator.best();\r
-                               URI uri = locator.get(item);\r
-                               if(uri!=null) {\r
-                                       StringBuilder sb = new StringBuilder(uri.toString());\r
-                                       String query = uri.getQuery();\r
-                                       boolean first = query==null || query.length()==0;\r
-                                       int count=0;\r
-                                       for(Redirectable t : redir) {\r
-                                               if(first) {\r
-                                                       sb.append('?');\r
-                                                       first=false;\r
-                                               }\r
-                                               else sb.append('&');\r
-                                               sb.append(t.get());\r
-                                               ++count;\r
-                                       }\r
-                                       if(count>0)return new LoginPageTafResp(access, resp, sb.toString());\r
-                               }\r
-                       } catch (Exception e) {\r
-                               access.log(e, "Error deriving Login Page location");\r
-                       }\r
-               } else if(!redir.isEmpty()) { \r
-                       access.log(Level.DEBUG,"LoginPage Locator is not configured. Taking first Redirectable Taf");\r
-                       return redir.get(0);\r
-               }\r
-               return NullTafResp.singleton();\r
-       }\r
-}\r