com.auth0.jwt.JWTAudienceException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-jwt Show documentation
Show all versions of java-jwt Show documentation
Java implementation of JSON Web Token (JWT)
package com.auth0.jwt;
import com.fasterxml.jackson.databind.JsonNode;
import java.util.ArrayList;
import java.util.List;
public class JWTAudienceException extends JWTVerifyException {
private JsonNode audienceNode;
public JWTAudienceException(JsonNode audienceNode) {
this.audienceNode = audienceNode;
}
public JWTAudienceException(String message, JsonNode audienceNode) {
super(message);
this.audienceNode = audienceNode;
}
public List getAudience() {
ArrayList audience = new ArrayList();
if (audienceNode.isArray()) {
for (JsonNode jsonNode : audienceNode) {
audience.add(jsonNode.textValue());
}
} else if (audienceNode.isTextual()) {
audience.add(audienceNode.textValue());
}
return audience;
}
}