MicroStrategy ONE

List of Permissions and Server APIs for iOS

The MicroStrategy Identity SDK includes several permissions for your third-party iOS app.

Permissions enumerations are reused between SSORequests and the authorize call described in Allowing iOS App Users to Sign-In with MicroStrategy Identity Using App-to-App Authentication.

If you are performing user interface (UI) tasks, always use dispatch_async to make sure you are on the main thread, as request handlers may not be called on the main queue.

After you obtain authentication, you can access the following server APIs to get information that corresponds to your permissions:

Account Name

Use this to retrieve a user's account name.

SSORequest *request = [[SSORequest alloc] initWithPermission:SSOUsherAccountName];
	[request startWithHandler:^(NSObject *response, NSError *error){
		if(response == nil){
			if(error != nil){

			}
		} else {
			SSOAccountInfo *accountInfo = (SSOAccountInfo*) response;
			// Query account info object for first name, last name, email, etc.
		}
});
	}];

Email Address

Use this to retrieve a user's email address.

SSORequest *request = [[SSORequest alloc] initWithPermission:SSOUsherAccountEmail];
	[request startWithHandler:^(NSObject *response, NSError *error){
dispatch_async(dispatch_get_main_queue(), ^{
		if(response == nil){
			if(error != nil){

			}
		} else {
			SSOAccountInfo *accountInfo = (SSOAccountInfo*) response;
			// Query account info object for first name, last name, email, etc.
		}
});
	}];

Profile Picture

Use this to retrieve a user's profile picture.

SSORequest *imgRequest = [[SSORequest alloc] initWithPermission:SSOUsherAccountProfilePicture];
	[imgRequest startWithHandler:^(NSObject *response, NSError *error){
dispatch_async(dispatch_get_main_queue(), ^{
		if(response == nil){
			if(error != nil){
				//handle error
			}
		} else {
			UIImage *image = (UIImage *)response;
			//image contains the profile image;
		}
});
	}];

Verifying a QR Code

Use this to retrieve an badge by providing a QR code in string format.

SSORequest *request = [[SSORequest alloc] initWithPermission:SSOVerifyQrCode];
	[request setCode:@"setCodeValue"];
	[request startWithHandler:^(NSObject *response, NSError *error){
dispatch_async(dispatch_get_main_queue(), ^{
		if(response == nil){
			if(error != nil){
				//handle error
			}
		} else {
			SSOBadge *badge = (SSOBadge *) response;
		}
});
	}];

Where:

  • setCodeValue is the QR code, in string format, of the badge to be retrieved.

Verifying an Badge Code

Use this to retrieve a badge by providing a numeric Badge Code in string format.

SSORequest *request = [[SSORequest alloc] initWithPermission:SSOVerifyQrCode];
	[request setCode:@"setCodeValue"];
	[request startWithHandler:^(NSObject *response, NSError *error){
		if(response == nil){
			if(error != nil){
				//handle error
			}
		} else {
			SSOBadge *badge = (SSOBadge *) response;
		}
});
	}];

Where:

  • setCodeValue = the numeric Badge Code, in string format, of the badge to be retrieved. For example, 1234.

Retrieving a MicroStrategy Badge

Use this to retrieve the badge that authorized your third-party app.

Copy
SSORequest *request = [[SSORequest alloc] initWithPermission:SSOViewBadge];
    [request startWithHandler:^(NSObject *response, NSError *error){
dispatch_async(dispatch_get_main_queue(), ^{
        if(response == nil){
            if(error != nil){
                //handle error
            }
        } else {
            SSOBadge *badge = (SSOBadge *) response;
        }
});
    }];

Related Topics

Editing a Mobile App Configuration in MicroStrategy Identity

Deleting a Mobile App from a MicroStrategy Identity Network

Creating a MicroStrategy Identity Network and Issuing an Administrator Badge