Skip to content

Commit

Permalink
remove unwanted dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
nenaraab authored and mwdb committed Jan 10, 2019
1 parent fee6d9d commit 41b8b62
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.util.LinkedHashMap;
import java.util.Map;

import com.sap.xs2.security.container.UserInfoTestUtil;
import org.apache.commons.io.IOUtils;
import org.springframework.security.jwt.JwtHelper;
import org.springframework.security.jwt.crypto.sign.RsaSigner;
Expand All @@ -21,7 +20,7 @@ public class JwtGenerator {
public static final Date NO_EXPIRE = new Date(Long.MAX_VALUE);

public static Jwt createFromTemplate(String pathToTemplate) throws Exception {
String claims = IOUtils.toString(UserInfoTestUtil.class.getResourceAsStream(pathToTemplate), StandardCharsets.UTF_8);
String claims = IOUtils.toString(JwtGenerator.class.getResourceAsStream(pathToTemplate), StandardCharsets.UTF_8);
return createFromClaims(claims);
}

Expand All @@ -34,7 +33,7 @@ public static Jwt createFromClaims(JWTClaimsSet claimsSet) throws Exception {
}

private static Jwt createFromClaims(String claims) throws Exception {
String privateKey = IOUtils.toString(UserInfoTestUtil.class.getResourceAsStream("/privateKey.txt"), StandardCharsets.UTF_8); // PEM format
String privateKey = IOUtils.toString(JwtGenerator.class.getResourceAsStream("/privateKey.txt"), StandardCharsets.UTF_8); // PEM format
String token = createToken(claims, privateKey, "legacy-samlUserInfo-key");
return convertTokenToOAuthJwt(token);
}
Expand Down

0 comments on commit 41b8b62

Please sign in to comment.