# Configure a Salesforce Connected Application to Work with SLAS

Learn how the Shopper Login and API Access Service (SLAS) can work with Salesforce as an identity provider (IDP) using OpenID Connect.

## Create the Connected Application

1. Log in to your Salesforce org.
2. From Setup, in the Quick Find box, enter `App`, and then select **App Manager**.
3. Click **New Connected App**.
4. Enter the connected app’s name. The name must be unique within the org.
5. Enter the API name used when referring to your app from a program. It defaults to a version of the name without spaces. Only letters, numbers, and underscores are allowed. If the original app name contains any other characters, edit the default name.
6. Enter a contact email.
7. Click **Enable OAuth Settings**.
8. Enter the **Callback URL**. Example URL: `https://$SHORTCODE.api.commercecloud.salesforce.com/shopper/auth/v1/idp/callback/salesforce`
9. Add the following OAuth Scopes to the list:
   1. **Access the identity URL service (id, profile, email, address, phone)**
   2. **Access unique user identifiers (openid)**
   3. **Full access (full)**
   4. **Manage user data via Web browsers (web)**
   5. **Perform requests at any time (refresh_token, offline_access)**
10. Click **Save**.
11. Click **Continue**.
12. Wait while the connected app is deployed.
13. For Consumer Secret, click **Manage Consumer Details**.
14. Copy the **Consumer Key** and **Consumer Secret** and save them in a password manager or other secure location.

## Configure SLAS for Salesforce IDP

Now create an IDP in SLAS for the Salesforce Connected app. Have the **Consumer Key** and **Consumer Secret** that you copied earlier handy.

Using the SLAS Admin UI or the SLAS Admin API, create a Salesforce IDP in SLAS. For more information about the API, see [Authorization for SCAPI Admin APIs](/docs/commerce/b2c-commerce/guide/authorization-for-admin-apis.md) and the [SLAS Admin API](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=slas-admin\:Summary) reference.

Example request:

```bash
curl "https://$SHORTCODE.api.commercecloud.salesforce.com/shopper/auth-admin/v1/tenants/$TENANT/idps/salesforce" \
  --request 'PUT' \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "name": "salesforce",
    "clientId": "'$CONNECTED_APP_CONSUMER_ID'",
    "clientSecret": "'$CONNECTED_APP_CONSUMER_SECRET'",
    "authUrl": "https://login.salesforce.com/services/oauth2/authorize",
    "tokenUrl": "https://login.salesforce.com/services/oauth2/token",
    "tokenInfoUrl": "https://login.salesforce.com/services/oauth2/introspect",
    "userInfoUrl": "https://login.salesforce.com/services/oauth2/userinfo",
    "redirectUrl": "https://"'$SHORTCODE'".api.commercecloud.salesforce.com/shopper/auth/v1/idp/callback/salesforce",
    "scopes": ["openid", "email", "profile"],
    "preferenceValue": false
}'
```
