summaryrefslogtreecommitdiffstats
path: root/auth/auth-oauth/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'auth/auth-oauth/src/main/java/org')
-rw-r--r--auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/AAF_OAuth.java17
-rw-r--r--auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/DirectOAuthTAF.java1
2 files changed, 16 insertions, 2 deletions
diff --git a/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/AAF_OAuth.java b/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/AAF_OAuth.java
index 1dac22fc..846d1a53 100644
--- a/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/AAF_OAuth.java
+++ b/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/AAF_OAuth.java
@@ -22,6 +22,7 @@
package org.onap.aaf.auth.oauth;
+import java.io.File;
import java.util.Map;
import javax.servlet.Filter;
@@ -45,6 +46,7 @@ import org.onap.aaf.auth.rserv.HttpCode;
import org.onap.aaf.auth.rserv.HttpMethods;
import org.onap.aaf.auth.server.AbsService;
import org.onap.aaf.auth.server.JettyServiceStarter;
+import org.onap.aaf.auth.server.Log4JLogIt;
import org.onap.aaf.cadi.CadiException;
import org.onap.aaf.cadi.LocatorException;
import org.onap.aaf.cadi.PropAccess;
@@ -183,10 +185,21 @@ public class AAF_OAuth extends AbsService<AuthzEnv,AuthzTrans> {
}
public static void main(final String[] args) {
- PropAccess propAccess = new PropAccess(args);
try {
+ String propsFile = getArg(AAF_LOG4J_PREFIX, args, "org.osaaf")+".log4j.props";
+ String log_dir = getArg(Config.CADI_LOGDIR,args,"./logs");
+ String log_level = getArg(Config.CADI_LOGLEVEL,args,"INFO");
+ File logs = new File(log_dir);
+ if(!logs.isDirectory()) {
+ logs.delete();
+ }
+ if(!logs.exists()) {
+ logs.mkdirs();
+ }
+ Log4JLogIt logIt = new Log4JLogIt(log_dir,log_level,propsFile, "oauth");
+ PropAccess propAccess = new PropAccess(logIt,args);
+
AAF_OAuth service = new AAF_OAuth(new AuthzEnv(propAccess));
-// env.setLog4JNames("log4j.properties","authz","oauth","audit","init","trace");
JettyServiceStarter<AuthzEnv,AuthzTrans> jss = new JettyServiceStarter<AuthzEnv,AuthzTrans>(service);
jss.start();
} catch (Exception e) {
diff --git a/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/DirectOAuthTAF.java b/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/DirectOAuthTAF.java
index e602e863..16d72686 100644
--- a/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/DirectOAuthTAF.java
+++ b/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/DirectOAuthTAF.java
@@ -101,6 +101,7 @@ public class DirectOAuthTAF implements HttpTaf {
}
if("application/x-www-form-urlencoded".equals(req.getContentType())) {
+ @SuppressWarnings("unchecked")
Map<String, String[]> map = req.getParameterMap();
String client_id=null,client_secret=null,username=null,password=null;
for(Map.Entry<String, String[]> es : map.entrySet()) {