cancel
Showing results for 
Search instead for 
Did you mean: 

System Connection & Credential Alias API For Custom Action in MII 12.1

former_member4529
Active Contributor
0 Kudos

Hi,

While creating a custom action for MII 12.1 I need to access the system connection aliases and credential aliases available in the system to display and use in the action block configuration. Is there any API available in the BLS SDK to access the aliases created in the System Connection Editor and Credential Store?

Thanks in advance,

Dipankar

Accepted Solutions (0)

Answers (4)

Answers (4)

suhas_nagaraju
Participant
0 Kudos

Hi Dipankar,

     The Illuminator service SystemInfo can be used with mode as CredentialList and ConnectionList respectively to get the lists. However ConnectionList expects 'type' parameter where the value is any one of the connection types present in MII.

Thanks,

Suhas

suhas_nagaraju
Participant
0 Kudos

It is the same as using IActionInstance in the Custom action blocks. Declare it as a method parameter in the action being defined and use it inside that method. During transaction runtime the implementation is executed.

Thanks,

Suhas

suhas_nagaraju
Participant
0 Kudos

Hi,

In MII 12.2 there is an interface called 'IAdminInstance' exposed through the BLS SDK which gives access to credential and connection stores.

Thanks,

Suhas

markus_reich
Participant
0 Kudos

Thank you for this information, but how to I get an instance of this interface?

regards

Markus

markus_reich
Participant
0 Kudos

Hi,

I'm looking for the same functionality, to you found a solution for this?

In my case, I have a custom action that reads data from a 3rd party app, so I want to use the MII credentials to forward these to the customer action, where I can you this credential to authenticate against the 3rd party app?

regards

Markus

markus_reich
Participant
0 Kudos

Hi,

I'm a step further!

There is a class com.sap.xmii.storage.credentials.Credential, now I would need a JAR File where this class is in?

I found following code for Custom Action using credentials:

private static Credential getCredentials(String alias, String username, PasswordData password, ILogWriter writer)
  {
    Credential credential = null;
    if (!(StringUtil.isNullOrEmpty(alias))) {
      try {
        credential = CredentialStoreManager.lookup(alias, CredentialType.BLS);
        if (credential == null) writer.log(LogLevel.ERROR, "Credential alias '" + alias + "' does not exist");
      }
      catch (Exception e) {
        writer.log(LogLevel.ERROR, "Unable to load credentials for alias " + alias + "; " + e.getLocalizedMessage());
      }

    }

    if (credential == null) {
      if (StringUtil.isNullOrEmpty(username)) {
        username = "anonymous";
        password = PasswordData.ANONYMOUS_PASSWORD;
      }
      credential = new Credential(username, password.getValue());
    }
    return credential;
  }