Skip to content

Commit

Permalink
feat(jans-auth-server): remove ox properties name (#3285)
Browse files Browse the repository at this point in the history
  • Loading branch information
Milton-Ch authored Dec 12, 2022
1 parent cd11750 commit f70b207
Show file tree
Hide file tree
Showing 20 changed files with 101 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class JwtAssertBuilder extends BaseAssertBuilder {
private Jwt jwt;
private boolean notNullAccesTokenHash;
private boolean notNullAuthenticationTime;
private boolean notNullOxOpenIDConnectVersion;
private boolean notNullJansOpenIDConnectVersion;
private boolean notNullAuthenticationContextClassReference;
private boolean notNullAuthenticationMethodReferences;
private boolean notNullClaimsAddressdata;
Expand All @@ -42,7 +42,7 @@ public JwtAssertBuilder(Jwt jwt) {
this.jwt = jwt;
this.notNullAccesTokenHash = false;
this.notNullAuthenticationTime = false;
this.notNullOxOpenIDConnectVersion = false;
this.notNullJansOpenIDConnectVersion = false;
this.notNullAuthenticationContextClassReference = false;
this.notNullAuthenticationMethodReferences = false;
this.claimsPresence = null;
Expand All @@ -65,8 +65,8 @@ public JwtAssertBuilder notNullAuthenticationTime() {
return this;
}

public JwtAssertBuilder notNullOxOpenIDConnectVersion() {
this.notNullOxOpenIDConnectVersion = true;
public JwtAssertBuilder notNullJansOpenIDConnectVersion() {
this.notNullJansOpenIDConnectVersion = true;
return this;
}

Expand Down Expand Up @@ -177,8 +177,8 @@ public void check() {
assertNotNullClaim(JwtClaimName.AUTHENTICATION_TIME);
if (notNullAccesTokenHash)
assertNotNullClaim(JwtClaimName.ACCESS_TOKEN_HASH);
if (notNullOxOpenIDConnectVersion)
assertNotNullClaim(JwtClaimName.OX_OPENID_CONNECT_VERSION);
if (notNullJansOpenIDConnectVersion)
assertNotNullClaim(JwtClaimName.JANS_OPENID_CONNECT_VERSION);
if (notNullAuthenticationContextClassReference)
assertNotNullClaim(JwtClaimName.AUTHENTICATION_CONTEXT_CLASS_REFERENCE);
if (notNullAuthenticationMethodReferences)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public void applicationTypeNativeSubjectTypePublic(
// 5. Validate id_token

AssertBuilder.jwtParse(idToken)
.validateSignatureRSA(jwksUri, SignatureAlgorithm.RS256)
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationTime()
.claimsPresence(JwtClaimName.CODE_HASH)
.check();
Expand Down Expand Up @@ -361,7 +361,7 @@ public void applicationTypeNativeSubjectTypePairwise(
// 5. Validate id_token

AssertBuilder.jwtParse(idToken)
.validateSignatureRSA(jwksUri, SignatureAlgorithm.RS256)
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationTime()
.claimsPresence(JwtClaimName.CODE_HASH)
.check();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void authorizationCodeFlow(
.validateSignatureRSAClientEngine(jwksUri, SignatureAlgorithm.RS256)
.claimsPresence(JwtClaimName.CODE_HASH)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationContextClassReference()
.notNullAuthenticationMethodReferences()
.check();
Expand Down Expand Up @@ -200,7 +200,7 @@ public void authorizationCodeFlowNegativeTest(
AssertBuilder.jwtParse(idToken)
.validateSignatureRSAClientEngine(jwksUri, SignatureAlgorithm.RS256)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.claimsPresence(JwtClaimName.CODE_HASH)
.check();

Expand Down Expand Up @@ -265,7 +265,7 @@ public void authorizationCodeWithNotAllowedScopeFlow(
AssertBuilder.jwt(jwt)
.claimsPresence(JwtClaimName.CODE_HASH)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationContextClassReference()
.notNullAuthenticationMethodReferences()
.check();
Expand Down Expand Up @@ -329,7 +329,7 @@ public void authorizationCodeDynamicScopeFlow(
// 3. Validate id_token
AssertBuilder.jwtParse(idToken)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.claimsPresence(JwtClaimName.CODE_HASH)
.check();

Expand Down Expand Up @@ -433,7 +433,7 @@ public void authorizationCodeFlowWithOptionalNonce(
AssertBuilder.jwt(jwt)
.validateSignatureRSAClientEngine(jwksUri, SignatureAlgorithm.RS256)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.claimsPresence(JwtClaimName.NONCE, JwtClaimName.CODE_HASH)
.check();
assertEquals(jwt.getClaims().getClaimAsString(JwtClaimName.NONCE), nonce);
Expand Down Expand Up @@ -619,7 +619,7 @@ public void authorizationCodeFlowLoginHint(
AssertBuilder.jwtParse(idToken)
.validateSignatureRSAClientEngine(jwksUri, SignatureAlgorithm.RS256)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.claimsPresence(JwtClaimName.CODE_HASH)
.check();

Expand Down Expand Up @@ -708,7 +708,7 @@ public void retainClaimAuthorizationCodeFlow(final String userId, final String u
AssertBuilder.jwt(jwt)
.claimsPresence(JwtClaimName.CODE_HASH)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationContextClassReference()
.notNullAuthenticationMethodReferences()
.check();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ public void requestAuthorizationTokenIdToken(
.accessToken(accessToken)
.claimsPresence(JwtClaimName.ACCESS_TOKEN_HASH)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationContextClassReference()
.notNullAuthenticationMethodReferences()
.check();
Expand Down Expand Up @@ -692,7 +692,7 @@ public void requestAuthorizationTokenIdTokenUserBasicAuth(
.accessToken(accessToken)
.claimsPresence(JwtClaimName.ACCESS_TOKEN_HASH)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationContextClassReference()
.notNullAuthenticationMethodReferences()
.check();
Expand Down Expand Up @@ -764,7 +764,7 @@ public void requestAuthorizationCodeIdToken(
.authorizationCode(code)
.claimsPresence(JwtClaimName.CODE_HASH)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationContextClassReference()
.notNullAuthenticationMethodReferences()
.check();
Expand Down Expand Up @@ -836,7 +836,7 @@ public void requestAuthorizationCodeIdTokenUserBasicAuth(
.authorizationCode(code)
.claimsPresence(JwtClaimName.CODE_HASH)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationContextClassReference()
.notNullAuthenticationMethodReferences()
.check();
Expand Down Expand Up @@ -1028,7 +1028,7 @@ public void requestAuthorizationTokenCodeIdToken(
.accessToken(accessToken)
.claimsPresence(JwtClaimName.CODE_HASH, JwtClaimName.ACCESS_TOKEN_HASH)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationContextClassReference()
.notNullAuthenticationMethodReferences()
.check();
Expand Down Expand Up @@ -1105,7 +1105,7 @@ public void requestAuthorizationTokenCodeIdTokenUserBasicAuth(
.accessToken(accessToken)
.claimsPresence(JwtClaimName.CODE_HASH, JwtClaimName.ACCESS_TOKEN_HASH)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationContextClassReference()
.notNullAuthenticationMethodReferences()
.check();
Expand Down Expand Up @@ -2459,7 +2459,7 @@ public void requestAuthorizationAccessTokenSubjectTypePublic(
.validateSignatureRSA(jwksUri, SignatureAlgorithm.RS256)
.claimsPresence(JwtClaimName.ACCESS_TOKEN_HASH)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationContextClassReference()
.notNullAuthenticationMethodReferences()
.check();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public void authorizationCodeFlow(
.validateSignatureRSAClientEngine(jwksUri, SignatureAlgorithm.RS256)
.claimsPresence(JwtClaimName.CODE_HASH)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationContextClassReference()
.notNullAuthenticationMethodReferences()
.check();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void authorizationCodeFlow(
AssertBuilder.jwtParse(idToken)
.validateSignatureRSA(jwksUri, SignatureAlgorithm.RS256)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.claimsPresence(JwtClaimName.CODE_HASH)
.check();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void enableClientToRestrictJavascriptOrigin(
// 4. Validate id_token
AssertBuilder.jwtParse(idToken)
.validateSignatureRSA(jwksUri, SignatureAlgorithm.RS256)
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.claimsPresence(JwtClaimName.CODE_HASH)
.check();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void requestIdTokenAlgRSAOAEPEncA256GCM(

Jwe jwe = Jwe.parse(idToken, privateKey, null);
AssertBuilder.jwe(jwe)
.claimsPresence(JwtClaimName.OX_OPENID_CONNECT_VERSION)
.claimsPresence(JwtClaimName.JANS_OPENID_CONNECT_VERSION)
.check();
} catch (Exception ex) {
fail(ex.getMessage(), ex);
Expand Down Expand Up @@ -170,7 +170,7 @@ public void requestIdTokenAlgRSA15EncA128CBCPLUSHS256(

Jwe jwe = Jwe.parse(idToken, privateKey, null);
AssertBuilder.jwe(jwe)
.claimsPresence(JwtClaimName.OX_OPENID_CONNECT_VERSION)
.claimsPresence(JwtClaimName.JANS_OPENID_CONNECT_VERSION)
.check();
} catch (Exception ex) {
fail(ex.getMessage(), ex);
Expand Down Expand Up @@ -238,7 +238,7 @@ public void requestIdTokenAlgRSA15EncA256CBCPLUSHS512(

Jwe jwe = Jwe.parse(idToken, privateKey, null);
AssertBuilder.jwe(jwe)
.claimsPresence(JwtClaimName.OX_OPENID_CONNECT_VERSION)
.claimsPresence(JwtClaimName.JANS_OPENID_CONNECT_VERSION)
.check();
} catch (Exception ex) {
fail(ex.getMessage(), ex);
Expand Down Expand Up @@ -300,7 +300,7 @@ public void requestIdTokenAlgA128KWEncA128GCM(
// 3. Read Encrypted ID Token
Jwe jwe = Jwe.parse(idToken, null, clientSecret.getBytes(StandardCharsets.UTF_8));
AssertBuilder.jwe(jwe)
.claimsPresence(JwtClaimName.OX_OPENID_CONNECT_VERSION)
.claimsPresence(JwtClaimName.JANS_OPENID_CONNECT_VERSION)
.check();
} catch (Exception ex) {
fail(ex.getMessage(), ex);
Expand Down Expand Up @@ -362,7 +362,7 @@ public void requestIdTokenAlgA256KWEncA256GCM(
// 3. Read Encrypted ID Token
Jwe jwe = Jwe.parse(idToken, null, clientSecret.getBytes(StandardCharsets.UTF_8));
AssertBuilder.jwe(jwe)
.claimsPresence(JwtClaimName.OX_OPENID_CONNECT_VERSION)
.claimsPresence(JwtClaimName.JANS_OPENID_CONNECT_VERSION)
.check();
} catch (Exception ex) {
fail(ex.getMessage(), ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void requestTokenRevocation1(
AssertBuilder.jwtParse(idToken)
.validateSignatureRSA(jwksUri, SignatureAlgorithm.RS256)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.claimsPresence(JwtClaimName.CODE_HASH)
.check();

Expand Down Expand Up @@ -289,7 +289,7 @@ public void requestTokenRevocation2(
AssertBuilder.jwtParse(idToken)
.validateSignatureRSA(jwksUri, SignatureAlgorithm.RS256)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.claimsPresence(JwtClaimName.CODE_HASH)
.check();

Expand Down Expand Up @@ -392,7 +392,7 @@ public void requestTokenRevocation3(
AssertBuilder.jwtParse(idToken)
.validateSignatureRSA(jwksUri, SignatureAlgorithm.RS256)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.claimsPresence(JwtClaimName.CODE_HASH)
.check();

Expand Down Expand Up @@ -504,7 +504,7 @@ public void requestTokenRevocationOptionalTokenTypeHint(
AssertBuilder.jwtParse(idToken)
.validateSignatureRSA(jwksUri, SignatureAlgorithm.RS256)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.claimsPresence(JwtClaimName.CODE_HASH)
.check();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void validateIdTokenHashes(
.accessToken(accessToken)
.state(state)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationContextClassReference()
.notNullAuthenticationMethodReferences()
.check();
Expand Down Expand Up @@ -134,7 +134,7 @@ public void validateIdTokenHashes(
.accessToken(accessToken2)
.claimsNoPresence(JwtClaimName.STATE_HASH)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationContextClassReference()
.notNullAuthenticationMethodReferences()
.check();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void deviceAuthzFlow(final String userId, final String userSecret) throws
// 5. Validate id_token
AssertBuilder.jwtParse(idToken)
.validateSignatureRSAClientEngine(jwksUri, SignatureAlgorithm.RS256)
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.check();

// 6. Request new access token using the refresh token.
Expand Down Expand Up @@ -330,7 +330,7 @@ public void deviceAuthzFlowWithCompleteVerificationUri(final String userId, fina
// 5. Validate id_token
AssertBuilder.jwtParse(idToken)
.validateSignatureRSAClientEngine(jwksUri, SignatureAlgorithm.RS256)
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.check();

// 6. Request new access token using the refresh token.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void requestAuthorizationWithPar(final String userId, final String userSe
.validateSignatureRSAClientEngine(jwksUri, SignatureAlgorithm.RS256)
.claimsPresence(JwtClaimName.CODE_HASH)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationContextClassReference()
.notNullAuthenticationMethodReferences()
.check();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private Pair<String, String> app1Flow(String userId, String userSecret, String r
.validateSignatureRSAClientEngine(jwksUri, SignatureAlgorithm.RS256)
.claimsPresence(JwtClaimName.CODE_HASH)
.notNullAuthenticationTime()
.notNullOxOpenIDConnectVersion()
.notNullJansOpenIDConnectVersion()
.notNullAuthenticationContextClassReference()
.notNullAuthenticationMethodReferences()
.notBlankDsHash()
Expand Down
Loading

0 comments on commit f70b207

Please sign in to comment.