Solution Authentication Service
The Solution Authentication service provides access to the solution user token. The service does not provide a direct access to the token but creates an authentication object that you can use to construct a REST client that can send requests to the VMware Aria Automation APIs.
You can access the Solution
Authentication service, no matter if the plug-in is Spring-enabled or not.
Procedure
- ♦
Access the service.
-
If the plug-in is Spring-enabled:
//Object must be declared in the spring context public class MyDomainObject { @Autowired private SolutionAuthenticationService solutionAuthenticationService; }
-
If the plug-in is not Spring-enabled:
public class PluginAdaptor implements IServiceRegistryAdaptor { private IServiceRegistry registry; private SolutionAuthenticationService solutionAuthenticationService; @Override public void setServiceRegistry(IServiceRegistry registry) { this.registry = registry; } public SolutionAuthenticationService getSolutionAuthenticationService() { if (solutionAuthenticationService == null) { solutionAuthenticationService = (SolutionAuthenticationService) registry.getService(IServiceRegistry.SOLUTION_AUTHENTICATION_SERVICE); } return solutionAuthenticationService; } }
-
If the plug-in is Spring-enabled: