Search Results for

    Show / Hide Table of Contents

    Connect an Java App

    Java applications can authenticate using The Identity Hub. This can be done using one of the Authentication Endpoints like OAuth, OpenID Connect... or using the Android SDK.

    SDK and Demo App.

    A preconfigured SDK can be downloaded from the App Configurations Details page.

    Or download the non-configured SDK from here.

    A demo app can be found here.

    Installing the SDK

    1. Download the SDK from the App Configurations Details page or download the non-configured SDK from here.
    2. Integrate the com.theidentityhub with your Java Project.

    Initialize the Identity Service

    IdentityService is;
    final String BASE_URL = "https://www.theidentityhub.com/{tenant}"; 
    final String CLIENT_ID = "[Your Application Client Id]"; 
     this.is = new IdentityService(CLIENT_ID, BASE_URL);
    

    Authenticate

        MainApp.this.is.tryAuthenticate();
        if (MainApp.this.is.tryAuthenticate()) {
         loadData();
         }
    

    Getting Profile Information

    final Profile object = this.is.getProfile();
    

    Getting information on the current user's accounts

    final ArrayList<AccountProvider> accountProviders = this.is.getAccounts()
    

    Getting information on the current user's roles

    final ArrayList<Role> roles = this.is.getRoles();
    
    In This Article