Package com.pingidentity.access
Class PingOneEnvironmentAccessor
- java.lang.Object
-
- com.pingidentity.access.PingOneEnvironmentAccessor
-
public class PingOneEnvironmentAccessor extends Object
Allows access to a PingOne connection and environment, given the value of a plugin configuration field based onPingOneEnvironmentFieldDescriptor.- Since:
- 10.2
-
-
Constructor Summary
Constructors Constructor Description PingOneEnvironmentAccessor(String connEnvFieldValue)Create an accessor given the value of a plugin configuration field based onPingOneEnvironmentFieldDescriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAccessToken()Exchange the connection credential for an access token.StringgetAuthenticationEndpoint(boolean withEnvironment)Get the authentication endpoint for this connection.StringgetEnvironmentId()Return the PingOne environment ID parsed from the config field value.StringgetManagementEndpoint()Get the management API endpoint for this connection.
-
-
-
Constructor Detail
-
PingOneEnvironmentAccessor
public PingOneEnvironmentAccessor(String connEnvFieldValue)
Create an accessor given the value of a plugin configuration field based onPingOneEnvironmentFieldDescriptor.- Parameters:
connEnvFieldValue- Configuration field value containing the connection and environment reference.
-
-
Method Detail
-
getEnvironmentId
public String getEnvironmentId()
Return the PingOne environment ID parsed from the config field value.- Returns:
- The PingOne environment ID.
-
getAuthenticationEndpoint
public String getAuthenticationEndpoint(boolean withEnvironment)
Get the authentication endpoint for this connection.- Parameters:
withEnvironment- Determines whether the environment ID is included in the returned URL.- Returns:
- The authentication endpoint.
-
getManagementEndpoint
public String getManagementEndpoint()
Get the management API endpoint for this connection.- Returns:
- The management API endpoint.
-
getAccessToken
public String getAccessToken() throws IOException
Exchange the connection credential for an access token. The token should be cached and reused until it becomes invalid.- Returns:
- An access token that can be used to call PingOne APIs.
- Throws:
InvalidConnectionCredentialException- If the connection credential is invalid.PingOneConnectionDisabledException- If the connection is disabled.IOException- If another error occurred.
-
-