Skip to content

Commit

Permalink
use unique filename to save pgt id
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwechner committed Jan 8, 2014
1 parent b95fad1 commit 48f7545
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -8,14 +8,15 @@
import java.io.ByteArrayInputStream;
import java.io.InputStream;

import org.apache.log4j.Logger;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

/**
* A simple Resource which extends BasicXMLResource
*/
public class CASProxyCallbackResource extends BasicXMLResource {

private static Logger log = Logger.getLogger(CASProxyCallbackResource.class);
private static Logger log = LogManager.getLogger(CASProxyCallbackResource.class);

/**
* This method overrides the method to create the InputStream called by BasicXMLResource
Expand All @@ -35,8 +36,7 @@ protected InputStream getContentXML(String viewId) throws Exception {
String pgtIou = getEnvironment().getRequest().getParameter("pgtIou"); // INFO: http://www.jusfortechies.com/java/cas/protocol.php#pgt-iou
if (pgtId != null && pgtIou != null) {
log.warn("DEBUG: pgt Id: " + pgtId + ", pgt Iou: " + pgtIou);
// TODO: Make it synchronized/multi-threaded. Also add the parameter 'pgtIou'
java.io.File proxyIdFile = new java.io.File(System.getProperty("java.io.tmpdir"), "cas-pgt-id.txt"); // INFO: The class src/webapp/src/java/org/wyona/yanel/servlet/security/impl/CASWebAuthenticatorImpl.java will read it from here
java.io.File proxyIdFile = new java.io.File(System.getProperty("java.io.tmpdir"), org.wyona.yanel.servlet.security.impl.CASWebAuthenticatorImpl.getProxyIdFilename(pgtIou));
java.io.FileOutputStream out = new java.io.FileOutputStream(proxyIdFile);
out.write(pgtId.getBytes());
out.close();
Expand Down

0 comments on commit 48f7545

Please sign in to comment.