MicroStrategy ONE

Use the MicroStrategy Identity SSO Library to Authenticate Your Android App

  1. Ask MicroStrategy Identity for permissions.

    SSOPermission[] permissions = new SSOPermissions[] {
    	SSOPermission.USHER_ACCOUNT_NAME,
    	SSOPermission.USHER_ACCOUNT_EMAIL,
    	SSOPermission.USHER_ACCOUNT_PROFILE_PICTURE};
    SSOClient ssoClient = SSOClient.getInstance();
    try {
    	ssoClient.authorize(permissions, clientId, orgId, packageName, context); 
    } catch (SSOException e) {
    }

    This example authorizes three permissions: profile picture, account name, and email. For a full list of permissions you can authorize, see List of permissions and server APIs for Android.

  2. Handle MicroStrategy Identity's response.

    public void onNewIntent(Intent intent) {
    Uri data = intent.getData();
    SSOClient ssoClient = SSOClient.getInstance();
    if(ssoClient.handleOpenURL(data)) {
    //successful
    String ssoToken = ssoClient.getToken();
    String badgeId = ssoClient.getBadgeId();
    }
    else {
    //error
    }
    }
  3. Make requests for data after you are authenticated.

Now that app configuration is complete, you can customize your app permissions using the List of permissions and server APIs for Android.