From b4c40c450772102de3873bc360b1e7025eacf28c Mon Sep 17 00:00:00 2001 From: "lucio.lelii" Date: Fri, 25 Nov 2016 14:11:16 +0000 Subject: [PATCH] git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/Common/authorization-common-client@134800 82a268e6-3cf1-43bd-a215-b396298e98cf --- distro/changelog.xml | 5 ++++- .../common/authorizationservice/cl/CallTest.java | 14 +++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) 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 {