Skip to content

Agent Management Client for Java

Introduction

The Agent Management Java client allows you to onboard, offboard, update and delete agents. It provides connectivity functions to enable communication with the MindSphere Platform.

See Agent Management for more information about the service.

Agent Operations

The Agents client lists, creates, updates, reads and deletes agents.

Client name: AgentsClient

Basic Agent Management

Create an Agent

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
// Construct the AgentsClient object
AgentsClient agentsClient = AgentsClient.builder()
                                        .mindsphereCredentials(credentials)
                                        .restClientConfig(config)
                                        .build();

Agent agent = null;
try {
  agent = agentsClient.createAgent(agentInput);
}catch (MindsphereException e) {
  // Exception handling
}

Create an Agent with SHARED_SECRET Security Profile

1
2
3
4
5
6
7
8
//Create client object "agentsClient" as shown above

Agent agent = null;
try {
  agent = agentsClient.createAgentWithSharedSecret(entityId, agentName);
}catch (MindsphereException e) {
  // Exception handling
}

Create an Agent with RSA Security Profile

1
2
3
4
5
6
7
8
//Create client object "agentsClient" as shown above

Agent agent = null;
try {
  agent = agentsClient.createAgentWithRSA(entityId, agentName);
}catch (MindsphereException e) {
  // Exception handling
}

List all Agents

Get all agents for the given filter input.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.getAllAgents(filter, size, page, sort);
} catch (MindsphereException e) {
  // Exception handling
}

Get an Agent by ID

Get an agent using agent ID.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

Agent agent = null;

try {
  agent = agentsClient.getAgentByID(agentId);
} catch (MindsphereException e) {
  // Exception handling
}

Update an Agent

Update an agent using agent ID.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

Agent agent = null;

try {
  agent = agentsClient.updateAgent(agentId, agentUpdate, ifMatch);
} catch (MindsphereException e) {
  // Exception handling
}

Delete an Agent

Delete an agent using agent ID.

1
2
3
4
5
6
7
//Create client object "agentsClient" as shown above

try {
  agentsClient.deleteAgent(agentId, ifMatch);
} catch (MindsphereException e) {
  // Exception handling
}

Get an Agent's Online Status

Get the online status of an agent using agent ID.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

OnlineStatus onlineStatus = null;

try {
  onlineStatus = agentsClient.getAgentOnlineStatus(agentId);
} catch (MindsphereException e) {
  // Exception handling
}

Filter Operations

Filter Agents by Name

Get a list of agents with a specific name.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.filterAgentsByName(filteredName);
} catch (MindsphereException e) {
  // Exception handling
}

Filter Agents by Names

Get a list of agents with one of the specified names.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.filterAgentsByNameIn(agentNames);
} catch (MindsphereException e) {
  // Exception handling
}

Filter Agents by Name in Descending Order

Get a list of agents with a specific name sorted in descending order.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.filterAgentsByNameInDescendingOrder(filteredName);
} catch (MindsphereException e) {
  // Exception handling
}

Filter Agents by the Start of the Name

Get a list of agents with a name that starts with a specific string.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.filterAgentsByNameStartsWith(startsWith);
} catch (MindsphereException e) {
  // Exception handling
}

Filter Agents by the End of the Name

Get a list of agents with a name that ends with a specific string.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.filterAgentsByNameEndsWith(endsWith);
} catch (MindsphereException e) {
  // Exception handling
}

Filter Agents by Part of the Name

Get a list of agents with a name that contains a specific string.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.filterAgentsByNameContains(contains);
} catch (MindsphereException e) {
  // Exception handling
}

Filter Agents by ID

Get a list of agents with a specific ID.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.filterAgentsByAgentId(filteredId);
} catch (MindsphereException e) {
  // Exception handling
}

Filter Agents by IDs

Get a list of agents with one of the specified IDs.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.filterAgentsByIdIn(agentIds);
} catch (MindsphereException e) {
  // Exception handling
}

Filter Agents by the Start of the ID

Get a list of agents with an ID that starts with a specific string.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.filterAgentsByIdStartsWith(startsWith);
} catch (MindsphereException e) {
  // Exception handling
}

Filter Agents by the End of the ID

Get a list of agents with an ID that ends with a specific string.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.filterAgentsByIdEndsWith(endsWith);
} catch (MindsphereException e) {
  // Exception handling
}

Filter Agents by Part of the ID

Get a list of agents with an ID that contains a specific string.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.filterAgentsByIdContains(contains);
} catch (MindsphereException e) {
  // Exception handling
}

Sort Operations

Sort Agents by Name

Get a list of agents sorted by name.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.sortAgentsByName();
} catch (MindsphereException e) {
  // Exception handling
}

Sort Agents by Name in Descending Order

Get a list of agents sorted in descending order by name.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.sortAgentsByNameDescendening();
} catch (MindsphereException e) {
  // Exception handling
}

Sort Agents by ID

Get a list of agents sorted by ID.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.sortAgentsById();
} catch (MindsphereException e) {
  // Exception handling
}

Sort Agents by ID in Descending Order

Get a list of agents sorted in descending order by ID.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.sortAgentsByIdDescendening();
} catch (MindsphereException e) {
  // Exception handling
}

Sort Agents by Entity ID

Get a list of agents sorted by entity ID.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.sortAgentsByEntityId();
} catch (MindsphereException e) {
  // Exception handling
}

Sort Agents by Entity ID in Descending Order

Get a list of agents sorted in descending order by entity ID.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.sortAgentsByEntityIdDescendening();
} catch (MindsphereException e) {
  // Exception handling
}

Sort Agents by Security Profile

Get a list of agents sorted by security profile.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.sortAgentsBySecurityProfile();
} catch (MindsphereException e) {
  // Exception handling
}

Sort Agents by Security Profile in Descending Order

Get a list of agents sorted in descending order by security profile.

1
2
3
4
5
6
7
8
9
//Create client object "agentsClient" as shown above

AgentsList agentsList = null;

try {
  agentsList = agentsClient.sortAgentsBySecurityProfileDescendening();
} catch (MindsphereException e) {
  // Exception handling
}

Default Settings Operations

The Agents Default Setting client is used to get the access token, client assertion and keys for RSA profile.

Client name: AgentsDefaultSettingClient

Get an Access Token

Access tokens are used to access MindSphere services. They can be fetched in the following ways:

  1. Creates an agent, onboards the agent and fetches an access token.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    // Construct the AgentsClient object
    AgentsDefaultSettingClient agentsDefaultSettingClient = AgentsDefaultSettingClient.builder()
                                            .mindsphereCredentials(credentials)
                                            .restClientConfig(config)
                                            .build();
    
    CreatedObjects createdObjects = null;
    try {
      createdObjects = agentsDefaultSettingClient.getAccessToken();
    }catch (MindsphereException e) {
      // Exception handling
    }
    
  2. Creates an agent with the given asset ID, name and security profile. Onboards the agent and fetches an access token.

    1
    2
    3
    4
    5
    6
    7
    8
    //Create client object "agentsDefaultSettingClient" as shown above
    
    CreatedObjects createdObjects = null;
    try {
      createdObjects = agentsDefaultSettingClient.getAccessToken(entityId, agentName, profile);
    }catch (MindsphereException e) {
      // Exception handling
    }
    
  3. Creates an agent with the given asset ID and name, onboards the agent and fetches an access token.

    1
    2
    3
    4
    5
    6
    7
    8
    //Create client object "agentsDefaultSettingClient" as shown above
    
    CreatedObjects createdObjects = null;
    try {
      createdObjects = agentsDefaultSettingClient.getAccessToken(entityId, agentName);
    }catch (MindsphereException e) {
      // Exception handling
    }
    

Get an Access Token with SHARED_SECRET

Access token with SHARED_SECRET security profile can be fetched in the following ways:

  1. Creates an agent with SHARED_SECRET security profile, onboards the agent and fetches an access token.

    1
    2
    3
    4
    5
    6
    7
    8
    //Create client object "agentsDefaultSettingClient" as shown above
    
    CreatedObjects createdObjects = null;
    try {
      createdObjects = agentsDefaultSettingClient.getAccessTokenWithSharedSecret();
    }catch (MindsphereException e) {
      // Exception handling
    }
    
  2. Creates an agent with SHARED_SECRET security profile for the given tenant, onboards the agent and fetches an access token.

    1
    2
    3
    4
    5
    6
    7
    8
    //Create client object "agentsDefaultSettingClient" as shown above
    
    CreatedObjects createdObjects = null;
    try {
      createdObjects = agentsDefaultSettingClient.getAccessTokenWithSharedSecret(tenant);
    }catch (MindsphereException e) {
      // Exception handling
    }
    

Get an Access Token with RSA

Access token with RSA security profile can be fetched in the following ways:

  1. Creates an agent with RSA security profile, onboards the agent and fetches an access token.

    1
    2
    3
    4
    5
    6
    7
    8
    //Create client object "agentsDefaultSettingClient" as shown above
    
    CreatedObjects createdObjects = null;
    try {
      createdObjects = agentsDefaultSettingClient.getAccessTokenWithRSA();
    }catch (MindsphereException e) {
      // Exception handling
    }
    
  2. Creates an agent with RSA security profile for the given tenant, onboards the agent and fetches an access token.

    1
    2
    3
    4
    5
    6
    7
    8
    //Create client object "agentsDefaultSettingClient" as shown above
    
    CreatedObjects createdObjects = null;
    try {
      createdObjects = agentsDefaultSettingClient.getAccessTokenWithRSA(tenant);
    }catch (MindsphereException e) {
      // Exception handling
    }
    

Get an Access Token for an Asset

Access token for an asset can be fetched in the following ways:

  1. Creates an agent for the given asset ID, onboards the agent and fetches an access token.

    1
    2
    3
    4
    5
    6
    7
    8
    //Create client object "agentsDefaultSettingClient" as shown above
    
    CreatedObjects createdObjects = null;
    try {
      createdObjects = agentsDefaultSettingClient.getAccessTokenForEntity(entityId);
    }catch (MindsphereException e) {
      // Exception handling
    }
    
  2. Creates an agent for the given asset ID and tenant, onboards the agent and fetches an access token.

    1
    2
    3
    4
    5
    6
    7
    8
    //Create client object "agentsDefaultSettingClient" as shown above
    
    CreatedObjects createdObjects = null;
    try {
      createdObjects = agentsDefaultSettingClient.getAccessTokenForEntity(entityId, tenant);
    }catch (MindsphereException e) {
      // Exception handling
    }
    

Get an Access Token for an Asset Type

Access token for an asset type can be fetched in the following ways:

  1. Creates an agent for the given asset type, onboards the agent and fetches an access token.

    1
    2
    3
    4
    5
    6
    7
    8
    //Create client object "agentsDefaultSettingClient" as shown above
    
    CreatedObjects createdObjects = null;
    try {
      createdObjects = agentsDefaultSettingClient.getAccessTokenForAssetType(assetType);
    }catch (MindsphereException e) {
      // Exception handling
    }
    
  2. Creates an agent for the given asset type and parent ID, onboards the agent and fetches an access token.

    1
    2
    3
    4
    5
    6
    7
    8
    //Create client object "agentsDefaultSettingClient" as shown above
    
    CreatedObjects createdObjects = null;
    try {
      createdObjects = agentsDefaultSettingClient.getAccessTokenForAssetType(assetType, assetParentId);
    }catch (MindsphereException e) {
      // Exception handling
    }
    
  3. Creates an agent for the given asset type, parent ID and tenant. Onboards the agent and fetches an access token.

    1
    2
    3
    4
    5
    6
    7
    8
    //Create client object "agentsDefaultSettingClient" as shown above
    
    CreatedObjects createdObjects = null;
    try {
      createdObjects = agentsDefaultSettingClient.getAccessTokenForAssetType(tenant, assetType, assetParentId);
    }catch (MindsphereException e) {
      // Exception handling
    }
    

Get an Access Token for an Agent

Access token for an existing agent can be fetched in the following ways:

  1. Onboards the agent and fetches an access token.

    1
    2
    3
    4
    5
    6
    7
    8
    //Create client object "agentsDefaultSettingClient" as shown above
    
    CreatedObjects createdObjects = null;
    try {
      createdObjects = agentsDefaultSettingClient.getAccessTokenForAgent(agentId);
    }catch (MindsphereException e) {
      // Exception handling
    }
    
  2. Onboards the agent for a given tenant and fetches an access token.

    1
    2
    3
    4
    5
    6
    7
    8
    //Create client object "agentsDefaultSettingClient" as shown above
    
    CreatedObjects createdObjects = null;
    try {
      createdObjects = agentsDefaultSettingClient.getAccessTokenForAgent(agentId, tenant);
    }catch (MindsphereException e) {
      // Exception handling
    }
    

Get an Access Token with Onboarding Configuration

Onboards the agent with a given configuration and fetches an access token.

1
2
3
4
5
6
7
8
//Create client object "agentsDefaultSettingClient" as shown above

CreatedObjects createdObjects = null;
try {
  createdObjects = agentsDefaultSettingClient.getAccessTokenWithOnBoardingConfig(boardingConfig);
}catch (MindsphereException e) {
  // Exception handling
}

Note

The boardingConfig object can be retrieved via boardingClient.getBoardingConfiguration(agentId).

Get an Access Token when Status is ONBOARDING

Onboards the agent and fetches an access token when its status is ONBOARDING.

1
2
3
4
5
6
7
8
//Create client object "agentsDefaultSettingClient" as shown above

CreatedObjects createdObjects = null;
try {
  createdObjects = agentsDefaultSettingClient.getAccessTokenDuringStatusOnBoarding(agentId);
}catch (MindsphereException e) {
  // Exception handling
}

Get Access Token after Onboarding with SHARED_SECRET

Fetches an access token when status is ONBOARDED for agents with SHARED_SECRET security profile.

1
2
3
4
5
6
7
8
//Create client object "agentsDefaultSettingClient" as shown above

AccessToken accessToken = null;
try {
  accessToken = agentsDefaultSettingClient.getAccessTokenAfterOnBoardedWithSharedSecret(agentId, tenant, clientSecret);
}catch (MindsphereException e) {
  // Exception handling
}

Note

The clientSecret string can be retrieved via registrationClient.onBoardAgent().

Get Access Token using Client Assertion

Fetches an access token using client assertion.

1
2
3
4
5
6
7
8
//Create client object "agentsDefaultSettingClient" as shown above

AccessToken accessToken = null;
try {
  accessToken = agentsDefaultSettingClient.getAccessTokenFromClientAssertion(clientAssertion);
}catch (MindsphereException e) {
  // Exception handling
}

Note

The clientAssertion string can be retrieved via agentsDefaultSettingClient.getClientAssertionForSharedSecret() or agentsDefaultSettingClient.getClientAssertionForRSA().

Get Keys for RSA

Generates public and private keys for an agent with RSA security profile.

1
2
3
4
5
6
7
8
//Create client object "agentsDefaultSettingClient" as shown above

JWKModel model = null;
try {
  model = agentsDefaultSettingClient.getKeysForRSAProfile();
}catch (MindsphereException e) {
  // Exception handling
}

Get Client Assertion for RSA

Generates client assertion for an agent with RSA security profile.

1
2
3
4
5
6
7
8
//Create client object "agentsDefaultSettingClient" as shown above

String clientAssertion = null;
try {
  clientAssertion = agentsDefaultSettingClient.getClientAssertionForRSAProfile(agentId, tenant);
}catch (MindsphereException e) {
  // Exception handling
}

Get Client Assertion for SHARED_SECRET

Generates client assertion for an agent with SHARED_SECRET security profile.

1
2
3
4
5
6
7
8
//Create client object "agentsDefaultSettingClient" as shown above

String clientAssertion = null;
try {
  clientAssertion = agentsDefaultSettingClient.getClientAssertionForSharedSecret(agentId, tenant, clientSecret);
}catch (MindsphereException e) {
  // Exception handling
}

Agent Data Source Configuration Operations

The Data Source Configuration client gets, creates and updates the data source configuration.

Client name: DataSourceConfigurationClient

Get the Data Source Configuration

Get the data source configuration for an agent with the given ID.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
// Construct the DataSourceConfigurationClient object
DataSourceConfigurationClient dataSourceConfigurationClient = DataSourceConfigurationClient.builder()
                                      .mindsphereCredentials(credentials)
                                      .restClientConfig(config)
                                      .build();

DataSourceConfiguration dataSourceConfiguration = null;
try {
  dataSourceConfiguration = dataSourceConfigurationClient.getDataSourceConfiguration(agentId);
} catch (MindsphereException e) {
  // Exception handling
}

Create the Data Source Configuration

Create the data source configuration for an agent with the given ID.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
//Create client object "dataSourceConfigurationClient" as shown above


//Create a DataSource object as follows:
DataSource dataSourcesItem = new DataSource();
dataSourcesItem.setName(name);
dataSourcesItem.setDescription(description);
dataSourcesItem.setDataPoints(dataPoints) {
dataSourcesItem.customData(customData) {

//Create a DataSourceConfigurationInput object as follows:
DataSourceConfigurationInput configuration = new DataSourceConfigurationInput();
configuration.setConfigurationId(configurationId);
configuration.addDataSourcesItem(dataSourcesItem);

DataSourceConfiguration dataSourceConfiguration = null;

try {
  dataSourceConfiguration = dataSourceConfigurationClient.createDataSourceConfiguration(agentId, configuration);
} catch (MindsphereException e) {
  // Exception handling
}

Update the Data Source Configuration

Update the data source configuration for an agent with the given ID.

1
2
3
4
5
6
7
8
9
//Create client object "dataSourceConfigurationClient" as shown above

DataSourceConfiguration dataSourceConfiguration = null;

try {
  dataSourceConfiguration = dataSourceConfigurationClient.updateDataSourceConfiguration(agentId, configuration, ifMatch);
} catch (MindsphereException e) {
  // Exception handling
}

Agent Boarding Operations

The Boarding client is used to offboard an agent and to get the boarding configuration and the boarding status.

Client name: BoardingClient

Get the Boarding Configuration

Get the boarding configuration of an agent with the given ID.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
// Construct the BoardingClient object
BoardingClient boardingClient = BoardingClient.builder()
                                      .mindsphereCredentials(credentials)
                                      .restClientConfig(config)
                                      .build();

BoardingConfiguration boardingConfiguration = null;
try {
  boardingConfiguration = boardingClient.getBoardingConfiguration(agentId);
} catch (MindsphereException e) {
  // Exception handling
}

Offboard an Agent

Offboard an agent with the given ID.

1
2
3
4
5
6
7
8
9
//Create client object "boardingClient" as shown above

OnboardingStatus onboardingStatus = null;

try {
  onboardingStatus = boardingClient.offBoard(agentId);
} catch (MindsphereException e) {
  // Exception handling
}

Get the Boarding Status

Get the boarding status of an agent with the given ID.

1
2
3
4
5
6
7
8
9
//Create client object "boardingClient" as shown above

OnboardingStatus onboardingStatus = null;

try {
  onboardingStatus = boardingClient.getBoardingStatus(agentId);
} catch (MindsphereException e) {
  // Exception handling
}

Agent Registration Operations

The Registration client can register an agent and update agent information.

Client name: RegistrationClient

Register an Agent

Register an agent.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
// Construct the RegistrationClient object
RegistrationClient registrationClient = RegistrationClient.builder()
                                      .mindsphereCredentials(credentials)
                                      .restClientConfig(config)
                                      .build();

ClientIdentifier clientIdentifier = null;
try {
  clientIdentifier = registrationClient.onBoardAgent(initialAccessToken, keys);
} catch (MindsphereException e) {
  /

Note

The initialAccessToken string can be obtained via boardingClient.getBoardingConfiguration(agentId).

Register an Agent with SHARED_SECRET Security Profile

1
2
3
4
5
6
7
//Create client object "registrationClient" as shown above

ClientIdentifier clientIdentifier = null;
try {
  clientIdentifier = registrationClient.onBoardAgentWithSharedSecretProfile(initialAccessToken);
} catch (MindsphereException e) {
  /

Register an Agent with RSA Security Profile

1
2
3
4
5
6
7
8
//Create client object "registrationClient" as shown above

ClientIdentifier clientIdentifier = null;
try {
  clientIdentifier = registrationClient.onBoardAgentWithRSAProfile(initialAccessToken, keys);
} catch (MindsphereException e) {
  // Exception handling
}

Update Client Information for SHARED_SECRET Security Profile

Update client information of a client with the given ID.

1
2
3
4
5
6
7
8
9
//Create client object "registrationClient" as shown above

ClientIdentifier clientIdentifier = null;

try {
  clientIdentifier = registrationClient.rotateKeysForSharedSecret(registrationAccessToken, clientId);
} catch (MindsphereException e) {
  // Exception handling
}

Update Client Information for RSA Security Profile

Update client information of a client with the given ID.

1
2
3
4
5
6
7
8
//Create client object "registrationClient" as shown above

ClientIdentifier clientIdentifier = null;
try {
  clientIdentifier = registrationClient.rotateKeysForRSA(registrationAccessToken, clientId, keys);
} catch (MindsphereException e) {
  // Exception handling
}

Agent Token Operations

The Token client is used to get the access token and the key information of OAuth server.

Client name: AccessTokenClient

Fetch an Access Token

Fetch an access token.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
// Construct the AccessTokenClient object
AccessTokenClient accessTokenClient = AccessTokenClient.builder()
                                      .mindsphereCredentials(credentials)
                                      .restClientConfig(config)
                                      .build();

AccessToken accessToken = null;
try {
  accessToken = accessTokenClient.getAccessToken(grantType, clientAssertionType, clientAssertion);
} catch (MindsphereException e) {
  // Exception handling
}

Provide Key Information of OAuth Server

Provide key information of OAuth server.

1
2
3
4
5
6
7
8
//Create client object "accessTokenClient" as shown above

TokenKey tokenKey = null;
try {
  tokenKey = accessTokenClient.getPublicKeyFromServer(ifNoneMatch);
} catch (MindsphereException e) {
  // Exception handling
}

Any questions left?

Ask the community


Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.