- Obtain OAuth tokens.
- Instantiate a
WebApiOptionsobject. - Define the IAuthorization credential type.
- Create the desired Agent class, passing in the
WebApiOptionsas a constructor parameter.
Instantiate a WebApiOptions object
WebApiOptions(string baseUrl);
The primary constructor accepts the target WebApi URL, https://sod.superoffice.com/cust12345/api, which is available as a claim in the ID token and system user token.
WebApiOptions inherits from RequestOptions, which contain the internationalization settings. These settings can also be passed into the overloaded constructor.
Define the IAuthorization credential type
The IAuthorization parameter is used to define the credential type and to set the Authorization attribute in each HTTP request. Assign an instance to theWebApiOptions.Authorization property.
Alternative 1:
Create and use the desired Agent
To create an Agent object, pass in theWebApiOptions as a constructor parameter.
This is the only Agent difference when compared to using the existing WCF SOAP proxies.