use of com.sap.cloud.security.xsuaa.DummyXsuaaServiceConfiguration in project cloud-security-xsuaa-integration by SAP.
the class XsuaaAudienceValidatorTest method setup.
@Before
public void setup() throws IOException {
serviceConfigurationSameClientId = new DummyXsuaaServiceConfiguration("sb-test1!t1", "test1!t1");
serviceConfigurationOtherGrantedClientId = new DummyXsuaaServiceConfiguration("sb-test2!t1", "test2!t1");
serviceConfigurationUnGrantedClientId = new DummyXsuaaServiceConfiguration("sb-test3!t1", "test3!t1");
serviceConfigurationBrokerPlan = new DummyXsuaaServiceConfiguration("sb-test3!b1", "test3!b1");
tokenWithAudience = new JwtGenerator().createFromTemplate("/audience_1.txt");
tokenWithoutAudience = new JwtGenerator().createFromTemplate("/audience_2.txt");
cloneTokenWithAudience = new JwtGenerator().createFromTemplate("/audience_3.txt");
claimsBuilder = new JWTClaimsSet.Builder().issueTime(new Date()).expirationTime(JwtGenerator.NO_EXPIRE_DATE);
claimsBuilder.claim(TokenClaims.CLAIM_CLIENT_ID, "sb-test1!t1");
}
use of com.sap.cloud.security.xsuaa.DummyXsuaaServiceConfiguration in project cloud-security-xsuaa-integration by SAP.
the class XsuaaAudienceValidatorForCloneTokenTest method setup.
@Before
public void setup() {
XsuaaServiceConfiguration serviceConfiguration = new DummyXsuaaServiceConfiguration("sb-test1!t1", "test1!t1");
cut = new XsuaaAudienceValidator(serviceConfiguration);
cut.configureAnotherXsuaaInstance(XSUAA_BROKER_XSAPPNAME, XSUAA_BROKER_CLIENT_ID);
claimsBuilder = new JWTClaimsSet.Builder().issueTime(new Date()).expirationTime(JwtGenerator.NO_EXPIRE_DATE);
}
use of com.sap.cloud.security.xsuaa.DummyXsuaaServiceConfiguration in project cloud-security-xsuaa-integration by SAP.
the class XsuaaAudienceValidatorTest method testOtherGrantedClientIdWithoutAudienceAndDot.
@Test
public void testOtherGrantedClientIdWithoutAudienceAndDot() {
OAuth2TokenValidatorResult result = new XsuaaAudienceValidator(new DummyXsuaaServiceConfiguration("sb-test4!t1", "test4!t1")).validate(tokenWithAudience);
Assert.assertFalse(result.hasErrors());
}
Aggregations