mirror of
https://github.com/OpenLiberty/liberty-bikes.git
synced 2025-03-07 11:26:52 +08:00
Set JWT issuer to current auth-service endpoint URL
This commit is contained in:
parent
ae8d4964ea
commit
6c2470b906
@ -105,7 +105,6 @@ public class GoogleCallback extends JwtAuth {
|
||||
|
||||
GoogleTokenResponse gResponse;
|
||||
Map<String, String> claims = new HashMap<String, String>();
|
||||
claims.put("iss", "https://accounts.google.com");
|
||||
try {
|
||||
gResponse = flow.newTokenRequest(code).setRedirectUri(callbackURL.toString()).execute();
|
||||
claims.putAll(introspectAuth(flow, gResponse));
|
||||
|
@ -33,6 +33,10 @@ public abstract class JwtAuth {
|
||||
@ConfigProperty(name = "jwtKeyStoreAlias", defaultValue = "bike")
|
||||
String keyStoreAlias;
|
||||
|
||||
@Inject
|
||||
@ConfigProperty(name = "auth_url", defaultValue = AuthApp.HTTPS_AUTH_SERVICE)
|
||||
String authUrl;
|
||||
|
||||
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
|
||||
onwardsClaims.setAudience("client");
|
||||
|
||||
onwardsClaims.setIssuer(claims.get("iss"));
|
||||
onwardsClaims.setIssuer(authUrl);
|
||||
// we set creation time to 24hrs ago, to avoid timezone issues in the
|
||||
// browser verification of the jwt.
|
||||
Calendar calendar1 = Calendar.getInstance();
|
||||
|
Loading…
Reference in New Issue
Block a user