Set JWT issuer to current auth-service endpoint URL

This commit is contained in:
Andrew Guibert 2018-05-10 13:27:27 -05:00
parent ae8d4964ea
commit 6c2470b906
2 changed files with 5 additions and 2 deletions

View File

@ -105,7 +105,6 @@ public class GoogleCallback extends JwtAuth {
GoogleTokenResponse gResponse; GoogleTokenResponse gResponse;
Map<String, String> claims = new HashMap<String, String>(); Map<String, String> claims = new HashMap<String, String>();
claims.put("iss", "https://accounts.google.com");
try { try {
gResponse = flow.newTokenRequest(code).setRedirectUri(callbackURL.toString()).execute(); gResponse = flow.newTokenRequest(code).setRedirectUri(callbackURL.toString()).execute();
claims.putAll(introspectAuth(flow, gResponse)); claims.putAll(introspectAuth(flow, gResponse));

View File

@ -33,6 +33,10 @@ public abstract class JwtAuth {
@ConfigProperty(name = "jwtKeyStoreAlias", defaultValue = "bike") @ConfigProperty(name = "jwtKeyStoreAlias", defaultValue = "bike")
String keyStoreAlias; String keyStoreAlias;
@Inject
@ConfigProperty(name = "auth_url", defaultValue = AuthApp.HTTPS_AUTH_SERVICE)
String authUrl;
protected static Key signingKey = null; protected static Key signingKey = null;
/** /**
@ -78,7 +82,7 @@ public abstract class JwtAuth {
// We'll use this claim to know this is a user token // We'll use this claim to know this is a user token
onwardsClaims.setAudience("client"); onwardsClaims.setAudience("client");
onwardsClaims.setIssuer(claims.get("iss")); onwardsClaims.setIssuer(authUrl);
// we set creation time to 24hrs ago, to avoid timezone issues in the // we set creation time to 24hrs ago, to avoid timezone issues in the
// browser verification of the jwt. // browser verification of the jwt.
Calendar calendar1 = Calendar.getInstance(); Calendar calendar1 = Calendar.getInstance();