Package org.openrdf.http.server.auth.cas

Source Code of org.openrdf.http.server.auth.cas.CasProxyCallback

/*
* Copyright Aduna (http://www.aduna-software.com/) (c) 2009.
*
* Licensed under the Aduna BSD-style license.
*/
package org.openrdf.http.server.auth.cas;

import org.restlet.data.Status;
import org.restlet.representation.EmptyRepresentation;
import org.restlet.representation.Representation;
import org.restlet.resource.ResourceException;
import org.restlet.resource.ServerResource;

/**
* @author Arjohn Kampman
*/
public class CasProxyCallback extends ServerResource {

  @Override
  protected void doInit() {
    super.doInit();
    setNegotiated(false);
  }

  @Override
  protected Representation get()
    throws ResourceException
  {
    String pgtId = getQuery().getFirstValue("pgtId");
    String pgtIou = getQuery().getFirstValue("pgtIou");

    if (pgtId != null && pgtIou != null) {
      return new EmptyRepresentation();
    }
    else {
      getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
      return null;
    }
  }
}
TOP

Related Classes of org.openrdf.http.server.auth.cas.CasProxyCallback

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.