In this Article
...
Snaps in the Coupa Snap Pack use the Coupa OAuth2 account to access the Coupa application. For the OAuth2 account to function without any issue, ensure to create and configure a connected App corresponding to the account as explained in the steps below. These steps also contain the information required to create/ define a new OAuth2 account for using this Snap Pack.
...
Creating an OAuth app in Coupa Portal
Coupa supports three Grant types: Authorization code, Client credentials, and Device code, but we provide support only for Authorization code and Client credentials grant types.
Prerequisite:
Admin access to Coupa
Info |
---|
|
...
Configuring an OAuth App with Client Credentials Grant type
Using Client Credentials Grant type you can create a client and generate Client ID and Client Secret to request for an access token.
Log into the Coupa portal.
Navigate to Setup > Integrations > Oauth2/OpenID Connect Clients.
Note: You can type also search for ‘oauth’ in the Search box to find Find it fast.Log into the <endpoint> portal. search box.Click Create in Oauth2/OpenID Connect Clients page.
In From the Grant type list, select Client credentials.
Specify the details for the client as shown below: Name for the Client, Login, Contact info, and Contact Email.in the image below:
Note: You must provide a unique Loginlogin id for Client Credentials Grant type,else Coupa displays an error,
Login has already been taken
.Select the
Cfm tooltip text Scopes are like a set of permissions set on the API key Scopes you would like want to include in this API setup. . To create a client app, we must select at least one scope and the scopes which provide access to specific APIs required for your functionality. Click the Scope to view the APIs that each Scope supports.
Note: To implement API permissions with OIDC, we've created several new scopes that provide access to specific functionality for the API.Click Save to save the client.
The client Identifier and Secret are generated to gain access to the API Scopes that you have configured.
Toggle Toggle Show/Hide to display and copy the Secret.
Once you create the client in Coupa, use the application or client to request an access token based on the grant type you configured.client secret.
Configuring an OAuth App with Authorization Code Grant type
Using the Authorization Code Grant type you can request the authorization endpoint for a code and use that code to request for an access token.
Steps 1 through 3 are common as mentioned in Configuring an OAuth App with Client Credentials Grant type.
From the Grant type list, select Authorization code.
Specify the details for the client as shown in the image below.
Select
offline_access
scope under Scopes.Click Save. The client Identifier and Secret are generated.
Get an OpenID Connect access token
...
Navigate to the <Snap Pack Name> Snap of your choice and configure the <Snap Pack Name> OAuth2 Account with the following details:
Client ID: A Public Identifier for your app. Provide the Client ID that is auto-generated after creating the app in the <endpoint>
Client Secret: Secret value known only to the app and the auth server. Provide the Client Secret that is auto-generated after creating the app in the <endpoint>.
OAuth2 Endpoint:
OAuth2 Token:
<Insert Account image>
Click Authorize.
You will be redirected to the login page of ServiceNow.Log into ServiceNow and accept the permissions.
The Access token and the Refresh Token will be generated.Select the Auto-refresh token checkbox and save the account.
...