cors
This commit is contained in:
parent
2a6b6ebef5
commit
1d75b50acb
2 changed files with 38 additions and 4 deletions
|
@ -4,10 +4,7 @@ import org.codehaus.jackson.annotate.JsonIgnore;
|
|||
import org.codehaus.jackson.annotate.JsonProperty;
|
||||
import org.jboss.resteasy.jwt.JsonWebToken;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||
|
@ -57,6 +54,8 @@ public class SkeletonKeyToken extends JsonWebToken {
|
|||
@JsonProperty("trusted-certs")
|
||||
protected Set<String> trustedCertificates;
|
||||
|
||||
@JsonProperty("allowed-origins")
|
||||
protected List<String> allowsOrigins;
|
||||
|
||||
@JsonProperty("realm_access")
|
||||
protected Access realmAccess;
|
||||
|
@ -144,6 +143,14 @@ public class SkeletonKeyToken extends JsonWebToken {
|
|||
return (SkeletonKeyToken) super.type(type);
|
||||
}
|
||||
|
||||
public List<String> getAllowsOrigins() {
|
||||
return allowsOrigins;
|
||||
}
|
||||
|
||||
public void setAllowsOrigins(List<String> allowsOrigins) {
|
||||
this.allowsOrigins = allowsOrigins;
|
||||
}
|
||||
|
||||
public Access getRealmAccess() {
|
||||
return realmAccess;
|
||||
}
|
||||
|
|
|
@ -95,6 +95,33 @@ public class SaasService {
|
|||
}
|
||||
}
|
||||
|
||||
@Path("ping")
|
||||
@GET
|
||||
@NoCache
|
||||
@Produces("text/plain")
|
||||
public String ping(@Context HttpHeaders headers) {
|
||||
logger.info("************** GET PING");
|
||||
for (String header : headers.getRequestHeaders().keySet()) {
|
||||
logger.info(" " + header + ": " + headers.getHeaderString(header));
|
||||
}
|
||||
return "ping";
|
||||
}
|
||||
|
||||
@Path("ping")
|
||||
@OPTIONS
|
||||
@NoCache
|
||||
@Produces("text/plain")
|
||||
public Response optionsPing(@Context HttpHeaders headers) {
|
||||
logger.info("************** OPTIONS PING");
|
||||
for (String header : headers.getRequestHeaders().keySet()) {
|
||||
logger.info(" " + header + ": " + headers.getHeaderString(header));
|
||||
}
|
||||
return Response.ok()
|
||||
.header("Access-Control-Allow-Origin", "*")
|
||||
.header("Access-Control-Allow-Headers", HttpHeaders.AUTHORIZATION).build();
|
||||
}
|
||||
|
||||
|
||||
@Path("keepalive")
|
||||
@GET
|
||||
@NoCache
|
||||
|
|
Loading…
Reference in a new issue