mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-04-01 22:14:01 +03:00
[FIX OpenID validate issuer and aud (#710)
Co-authored-by: d3coder <admin@xakeps.dk>
This commit is contained in:
parent
bd4ec738a2
commit
1cbaf4eea3
2 changed files with 6 additions and 2 deletions
|
@ -36,7 +36,10 @@ public class OpenIDAuthenticator {
|
||||||
public OpenIDAuthenticator(OpenIDConfig openIDConfig) {
|
public OpenIDAuthenticator(OpenIDConfig openIDConfig) {
|
||||||
this.openIDConfig = openIDConfig;
|
this.openIDConfig = openIDConfig;
|
||||||
var keyLocator = loadKeyLocator(openIDConfig);
|
var keyLocator = loadKeyLocator(openIDConfig);
|
||||||
this.jwtParser = Jwts.parser().keyLocator(keyLocator)
|
this.jwtParser = Jwts.parser()
|
||||||
|
.keyLocator(keyLocator)
|
||||||
|
.requireIssuer(openIDConfig.issuer())
|
||||||
|
.requireAudience(openIDConfig.clientId())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
public record OpenIDConfig(URI tokenUri, String authorizationEndpoint, String clientId, String clientSecret,
|
public record OpenIDConfig(URI tokenUri, String authorizationEndpoint, String clientId, String clientSecret,
|
||||||
String redirectUri, URI jwksUri, String scopes, ClaimExtractorConfig extractorConfig) {
|
String redirectUri, URI jwksUri, String scopes, String issuer,
|
||||||
|
ClaimExtractorConfig extractorConfig) {
|
||||||
|
|
||||||
public record ClaimExtractorConfig(String usernameClaim, String uuidClaim) {}
|
public record ClaimExtractorConfig(String usernameClaim, String uuidClaim) {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue