Skip to content

Commit

Permalink
formatting fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
augi committed Aug 20, 2019
1 parent 73b4a8a commit 1075cc9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public KeycloakJwtServerInterceptor(JwtTokenParser<AccessToken> tokenParser) {

public static KeycloakJwtServerInterceptor fromConfig(Config config) {
Config fc = config.withFallback(DefaultConfig);
KeycloakJwtTokenParser tokenParser = KeycloakJwtTokenParser.create(fc.getString("serverUrl"), fc.getString("realm"));
KeycloakJwtTokenParser tokenParser =
KeycloakJwtTokenParser.create(fc.getString("serverUrl"), fc.getString("realm"));
tokenParser = tokenParser.withExpectedAudience(fc.getString("expectedAudience"));
tokenParser = tokenParser.withExpectedIssuedFor(fc.getString("expectedIssuedFor"));
return new KeycloakJwtServerInterceptor(tokenParser);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

import com.avast.grpc.jwt.server.JwtTokenParser;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Strings;
import java.net.URL;
import java.security.PublicKey;

import com.google.common.base.Strings;
import org.keycloak.TokenVerifier;
import org.keycloak.common.VerificationException;
import org.keycloak.constants.ServiceUrlConstants;
Expand Down Expand Up @@ -42,7 +41,8 @@ public AccessToken parseToValid(String jwtToken) throws VerificationException {
}

protected TokenVerifier<AccessToken> createTokenVerifier(String jwtToken) {
TokenVerifier<AccessToken> verifier = TokenVerifier.create(jwtToken, AccessToken.class).withChecks(checks).publicKey(publicKey);
TokenVerifier<AccessToken> verifier =
TokenVerifier.create(jwtToken, AccessToken.class).withChecks(checks).publicKey(publicKey);
if (!Strings.isNullOrEmpty(expectedAudience)) {
verifier = verifier.audience(expectedAudience);
}
Expand Down

0 comments on commit 1075cc9

Please sign in to comment.