2 * ============LICENSE_START====================================================
4 * ===========================================================================
5 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
6 * ===========================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END====================================================
22 package org.onap.aaf.auth.gui.pages;
24 import java.io.IOException;
26 import org.onap.aaf.auth.env.AuthzTrans;
27 import org.onap.aaf.auth.gui.AAF_GUI;
28 import org.onap.aaf.auth.gui.BreadCrumbs;
29 import org.onap.aaf.auth.gui.NamedCode;
30 import org.onap.aaf.auth.gui.Page;
31 import org.onap.aaf.misc.env.APIException;
32 import org.onap.aaf.misc.env.Slot;
33 import org.onap.aaf.misc.xgen.Cache;
34 import org.onap.aaf.misc.xgen.DynamicCode;
35 import org.onap.aaf.misc.xgen.html.HTMLGen;
37 public class LoginLandingAction extends Page {
38 public LoginLandingAction(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException {
39 super(gui.env,"Login",LoginLanding.HREF, LoginLanding.fields,
40 new BreadCrumbs(breadcrumbs),
41 new NamedCode(true,"content") {
42 final Slot sID = gui.env.slot(LoginLanding.NAME+'.'+LoginLanding.fields[0]);
43 // final Slot sPassword = gui.env.slot(LoginLanding.NAME+'.'+LoginLanding.fields[1]);
46 public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException {
47 cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI, AuthzTrans>() {
49 public void code(final AAF_GUI gui, final AuthzTrans trans,final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException {
50 String username = trans.get(sID,null);
51 // String password = trans.get(sPassword,null);
53 hgen.p("User: "+username);
54 hgen.p("Pass: ********");
56 // TODO: clarification from JG
57 // put in request header?
58 // then pass through authn/basicAuth call?