Symantec IGA

 View Only
  • 1.  get user accounts via BLTH

    Posted Aug 14, 2023 10:42 AM

    hi everyone,

     im having trouble to get user all accounts on execution of BLTH via blthContext object in java.

    Below object should get me logged-in user accounts but returned 'com.netegrity.llsdk6.imsimpl.managedobject.AccountImpl@1sss11d2]'.

    'blthcontext.getUser().getAccounts()'  

    Any help will be appreciated.

    Thanks



  • 2.  RE: get user accounts via BLTH

    Posted Sep 19, 2023 01:04 PM

    Hi

    You need to iterate through the accounts and extract the relevant information.

    Here an Ex: 

    import com.netegrity.llsdk6.imsimpl.managedobject.Account;
    import com.netegrity.llsdk6.imsimpl.managedobject.User;
    
    // Assuming you have the BLTHContext object named blthContext
    
    User user = blthContext.getUser();
    Account[] accounts = user.getAccounts();
    
    for (Account account : accounts) {
        String accountName = account.getAccountName(); // Get the account name
        // Other properties you may want to retrieve
        // Example:
        // String accountDescription = account.getDescription();
        // String accountType = account.getType();
        
        // Print or process the account information as needed
        System.out.println("Account Name: " + accountName);
        // Print other account properties if needed
    }
    

    Please make sure you have the CA Single Sign-On SDK properly configured in your Java project to access the required classes and methods.