1 /*******************************************************************************
\r
2 * ============LICENSE_START====================================================
\r
4 * * ===========================================================================
\r
5 * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * * ===========================================================================
\r
7 * * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * * you may not use this file except in compliance with the License.
\r
9 * * You may obtain a copy of the License at
\r
11 * * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * * Unless required by applicable law or agreed to in writing, software
\r
14 * * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * * See the License for the specific language governing permissions and
\r
17 * * limitations under the License.
\r
18 * * ============LICENSE_END====================================================
\r
20 * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
\r
22 ******************************************************************************/
\r
23 package org.onap.aaf.cadi.taf;
\r
25 import java.io.IOException;
\r
26 import java.security.Principal;
\r
28 import org.onap.aaf.cadi.Access;
\r
29 import org.onap.aaf.cadi.CadiException;
\r
32 * Response from Taf objects, which inform users what has happened and/or what should be done
\r
36 public interface TafResp {
\r
37 public static enum RESP {
\r
39 NO_FURTHER_PROCESSING,
\r
40 TRY_AUTHENTICATING,
\r
43 // A note was made to avoid the response REDIRECT. However, I have deemed that it is
\r
44 // unavoidable when the underlying TAF did do a REDIRECT, because it requires a HTTP
\r
45 // Service code to exit without modifying the Response any further.
\r
46 // Therefore, I have changed this to indicate what HAS happened, with should accommodate
\r
47 // both positions. JG 10/18/2012
\r
48 // public static final int HTTP_REDIRECT_INVOKED = 11;
\r
49 HTTP_REDIRECT_INVOKED,
\r
53 * Basic success check
\r
56 public boolean isValid();
\r
59 * String description of what has occurred (for logging/exceptions)
\r
62 public String desc();
\r
68 public RESP isAuthenticated();
\r
71 * Authenticate, returning FAIL or Other Valid indication
\r
73 * HTTP implementations should watch for "HTTP_REDIRECT_INVOKED", and end the HTTP call appropriately.
\r
75 * @throws CadiException
\r
77 public RESP authenticate() throws IOException;
\r
80 * Once authenticated, this object should hold a Principal created from the authorization
\r
83 public Principal getPrincipal();
\r
86 * get the Access object which created this object, allowing the responder to appropriate Log, etc
\r
88 public Access getAccess();
\r
91 * Be able to check if part of a Failed attempt
\r
93 public boolean isFailedAttempt();
\r