Using OAuth Authentication
OAuth requires the authenticating user to interact with OData using the browser. Most OData services will not require OAuth. This section is only for OData endpoints that require OAuth. The cmdlet facilitates this in various ways as described below.
Required OAuth Connection Properties
There are several required connection properties to establish an OAuth connection. These must be obtained from the API documentation of the OData service you are connecting to.
- OAuthVersion: The version of OAuth being used. Enter 1.0 or 2.0.
- OAuthAccessTokenURL: The URL to retrieve the OAuth access token from.
- OAuthAuthorizationURL: The URL that needs to be opened in the browser for the user to grant permissions.
- OAuthRefreshTokenURL: The URL to use when refreshing an expired access token.
- OAuthRequestTokenURL: The URL the service provides to retrieve request tokens from. Required in OAuth 1.0.
- OAuthGrantType: The grant type for the OAuth flow. Can be either CLIENT, CODE or PASSWORD.
- OAuthParams: A comma-separated list of other parameters to submit in the request for the OAuth access token in the format paramname=value.
Creating a Custom OAuth App
In addition to the previously mentioned connection properties, you will need to register an app to obtain the OAuthClientId and OAuthClientSecret. See Creating a Custom OAuth App for information on creating a custom app.