The resolver toolkit provides an Ant task to login to an AstroGrid Community service.
The task validates an Account password and returns a new SecurityToken.
The following Ant script fragment registers the password resolver as an Ant task.
<taskdef name="login.task" classname="org.astrogrid.community.resolver.ant.CommunityPasswordResolverTask">
<classpath refid="resolver.classpath"/>
</taskdef>
The login.live Ant task uses a live Registry service to resolve the endpoint of a Community
service, and then calls the service to validate the Account password.
The following command will run the login task, using a live Registry service to resolve the Community service.
ant -f resolver.xml login.live
The command invokes the following Ant script to run the password resolver, using a live Registry service to resolve the Community service.
<!--+
| Login to our service, using a live registry service.
+-->
<target name="login.live" depends="">
<echo message=""/>
<echo message="Login test ...."/>
<!--+
| Login to get our first token.
+-->
<login.task
registry="${org.astrogrid.registry.url}"
account="${org.astrogrid.community.account}"
password="qwerty"
/>
</target>
The login task requires the following parameters :
If the login succeeds the task will store the new token in an Ant property called org.astrogrid.community.token.
Before using the login task, check that the Account identifier and registry URL have been configured.
See Resolver properties
There are reported problems when using the local registry files on a Windows system.
The login.local Ant task uses local Registry files to resolve the endpoint of a Community
service, and then calls the Community service to validate the Account identifier and password.
The following command will run the login task, using local Registry files to resolve the Community service.
ant -f resolver.xml login.local
The command invokes the following Ant script to run the password resolver, using local Registry properties to resolve the Community service.
<!--+
| Login to our service, using the local registry config.
+-->
<target name="login.local" depends="">
<echo message=""/>
<echo message="Login test ...."/>
<!--+
| Login to get our first token.
+-->
<login.task
properties="${basedir}/config/registry.properties"
account="${org.astrogrid.community.account}"
password="qwerty"
/>
</target>
The login task requires the following parameters :
If the login succeeds the task will store the new token in an Ant property called org.astrogrid.community.token.