diff --git a/distro/changelog.xml b/distro/changelog.xml index ad0f580..832c470 100644 --- a/distro/changelog.xml +++ b/distro/changelog.xml @@ -3,6 +3,9 @@ First Release - moving to auth2 + moving to auth2 service + + + added calls for ExternalServiceToken generator \ No newline at end of file diff --git a/src/test/java/org/gcube/common/authorizationservice/cl/CallTest.java b/src/test/java/org/gcube/common/authorizationservice/cl/CallTest.java index c044e11..f79107b 100644 --- a/src/test/java/org/gcube/common/authorizationservice/cl/CallTest.java +++ b/src/test/java/org/gcube/common/authorizationservice/cl/CallTest.java @@ -38,6 +38,18 @@ public class CallTest { System.out.println(authorizationService().resolveTokenByUserAndContext("alessandro.pieve", "/gcube/devsec")); } + @Test + public void requestExternalServiceToken() throws Exception { + SecurityTokenProvider.instance.set(requestTestToken("/gcube/devsec")); + System.out.println(authorizationService().generateExternalServiceToken("OBISTest")); + } + + @Test + public void getExternalServiceToken() throws Exception { + SecurityTokenProvider.instance.set(requestTestToken("/gcube/devsec")); + System.out.println(authorizationService().retrieveExternalServiceGenerated()); + } + @Test public void requestNodeToken() throws Exception { System.out.println(_requestNodeToken()); @@ -66,7 +78,7 @@ public class CallTest { @Test public void generateToken() throws Exception{ - System.out.println(authorizationService().generateUserToken(new UserInfo("alessandro.pieve", new ArrayList()), "/gcube/devsec")); + System.out.println(authorizationService().generateUserToken(new UserInfo("alessandro.pieve", new ArrayList()), "/gcube/devNext")); } @Test(expected=RuntimeException.class) public void createKeyWithError() throws Exception {