OnAuthorizeAccount()

View as Markdown

Definition

If the IsAuthorizationRequired property is set to true, this method will be called when the user clicks the Connect button in the Share Services dialogue under Tools -> Options. When this method is called, it will allow you to go through the handshake process for authorizing the account to a sharing service. For example, you can obtain user tokens for posting on their behalf to social networks using OAuth authentication.

Documentation on the OAuth handshake process can be found from the official OAuth website: OAuth

Specific documentation for the authorization process for a particular sharing service can be found on its public API resources located on their website.

Method Return Value

An asynchronous Task

Parameters

This method does not require any parameters.

Syntax

This method is not required to be overridden. You may override the method in your Share Service with the following syntax if needed:

public override async Task OnAuthorizeAccount()

Examples

1public override async Task OnAuthorizeAccount()
2{
3 //MyShareServicesToken() is a place holder for an actual API's token method
4 string result = await MyShareServicesToken("myToken");
5
6 // result is also a place holder
7 if(result == "APIErrorCode123")
8 {
9 Print("Unable to authorize token");
10 return;
11 }
12
13 // please see the your API's OUATH documentation for proper handshake usage
14 else Print("Success!");