File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
main/java/com/sap/cloud/security/xsuaa/token/authentication
test/java/com/sap/cloud/security/xsuaa/token/authentication Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 22
33All notable changes to this project will be documented in this file.
44## 1.3.1
5- * Broker plan validation failed due to incorrectaudience validation
5+ * Broker plan validation failed due to incorrect audience validation
66## 1.3.0
77* JwtGenerator offers enhancement options: custom claims and audience
88* Test framework support for multi tenancy
Original file line number Diff line number Diff line change @@ -28,8 +28,9 @@ public XsuaaAudienceValidator(XsuaaServiceConfiguration xsuaaServiceConfiguratio
2828 public OAuth2TokenValidatorResult validate (Jwt token ) {
2929 // case 1 : token issued by own client (or master)
3030 if (xsuaaServiceConfiguration .getClientId ().equals (token .getClaimAsString ("client_id" ))
31- || (xsuaaServiceConfiguration .getAppId ().contains ("!b" ) && token .getClaimAsString ("client_id" ).contains ("|" ) && token .getClaimAsString ("client_id" ).endsWith ("|" +xsuaaServiceConfiguration .getAppId ())))
32- {
31+ || (xsuaaServiceConfiguration .getAppId ().contains ("!b" )
32+ && token .getClaimAsString ("client_id" ).contains ("|" )
33+ && token .getClaimAsString ("client_id" ).endsWith ("|" + xsuaaServiceConfiguration .getAppId ()))) {
3334 return OAuth2TokenValidatorResult .success ();
3435 } else {
3536 // case 2: foreign token
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ public class XsuaaAudienceValidatorTest {
2323 private Jwt cloneTokenWithoutAudience ;
2424 private Jwt cloneTokenWithAudience ;
2525
26-
2726 private XsuaaServiceConfiguration serviceConfigurationSameClientId ;
2827 private XsuaaServiceConfiguration serviceConfigurationOtherGrantedClientId ;
2928 private XsuaaServiceConfiguration serviceConfigurationUnGrantedClientId ;
@@ -127,12 +126,14 @@ public void testOtherGrantedClientIdWithoutAudienceAndEmptyScopes() {
127126 .validate (tokenWithoutAudienceAndScopes );
128127 Assert .assertTrue (result .hasErrors ());
129128 }
129+
130130 @ Test
131131 public void testBrokerCloneWithAudience () {
132132 OAuth2TokenValidatorResult result = new XsuaaAudienceValidator (serviceConfigurationBrokerPlan )
133133 .validate (cloneTokenWithAudience );
134134 Assert .assertFalse (result .hasErrors ());
135135 }
136+
136137 @ Test
137138 public void testBrokerCloneWithoutAudience () {
138139 OAuth2TokenValidatorResult result = new XsuaaAudienceValidator (serviceConfigurationBrokerPlan )
You can’t perform that action at this time.
0 commit comments