You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2019/02/20 12:57:41 UTC
[cxf] branch master updated: Configuring the issuer for an OAuth
JWT test
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/master by this push:
new bc7d9c0 Configuring the issuer for an OAuth JWT test
bc7d9c0 is described below
commit bc7d9c0b017be38c7aa066eaad179cb6df7ef4ab
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Wed Feb 20 12:57:11 2019 +0000
Configuring the issuer for an OAuth JWT test
---
.../jaxrs/security/oauth2/common/JCacheOAuthDataProviderImpl.java | 1 +
.../systest/jaxrs/security/oauth2/grants/AuthorizationGrantTest.java | 2 ++
2 files changed, 3 insertions(+)
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/common/JCacheOAuthDataProviderImpl.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/common/JCacheOAuthDataProviderImpl.java
index 6678a29..966f86b 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/common/JCacheOAuthDataProviderImpl.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/common/JCacheOAuthDataProviderImpl.java
@@ -176,6 +176,7 @@ public class JCacheOAuthDataProviderImpl extends JCacheCodeDataProvider {
protected ServerAccessToken createNewAccessToken(Client client, UserSubject userSub) {
ServerAccessToken token = super.createNewAccessToken(client, userSub);
token.setNotBefore((System.currentTimeMillis() / 1000L) - 5L);
+ token.setIssuer("jwt-issuer");
return token;
}
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantTest.java
index 0bbc369..99d36d5 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantTest.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantTest.java
@@ -56,6 +56,7 @@ import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized.Parameters;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -547,6 +548,7 @@ public class AuthorizationGrantTest extends AbstractBusClientServerTestBase {
assertNotNull(jwt.getClaim(JwtConstants.CLAIM_SUBJECT));
assertNotNull(jwt.getClaim(JwtConstants.CLAIM_EXPIRY));
assertNotNull(jwt.getClaim(JwtConstants.CLAIM_ISSUED_AT));
+ assertEquals("jwt-issuer", jwt.getClaim(JwtConstants.CLAIM_ISSUER));
KeyStore keystore = KeyStore.getInstance("JKS");
keystore.load(ClassLoaderUtils.getResourceAsStream("keys/alice.jks", this.getClass()),